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

[C++] Compilation errors when re2::StringPiece is different from std::string_view #38282

Closed
felipecrv opened this issue Oct 16, 2023 · 1 comment · Fixed by #38283
Closed
Assignees
Labels
Milestone

Comments

@felipecrv
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

Compilation errors when re2::StringPiece is different from std::string_view.

@felipecrv I am validating but this seems to make the test-build-vcpkg-win build to fail on the maintenance branch:

D:/a/crossbow/crossbow/arrow/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc(1970,1): error C2664: 'arrow::Status arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>::ReplaceString(re2::StringPiece,arrow::TypedBufferBuilder<uint8_t,void> *) const': cannot convert argument 1 from 'std::string_view' to 're2::StringPiece' (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx) [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]
D:/a/crossbow/crossbow/arrow/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc(1970,1): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx) [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]
D:/a/crossbow/crossbow/arrow/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc(2066,10): message : see declaration of 'arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>::ReplaceString' (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx) [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]
D:/a/crossbow/crossbow/arrow/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc(1962): message : while compiling class template member function 'arrow::Status arrow::compute::internal::`anonymous-namespace'::ReplaceSubstring<arrow::LargeStringType,arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>>::Replace(arrow::compute::KernelContext *,const arrow::compute::ExecSpan &,const Replacer &,arrow::compute::ExecResult *)' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]
          with
          [
              Replacer=arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>
          ] (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx)
D:/a/crossbow/crossbow/arrow/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc(1958): message : see reference to function template instantiation 'arrow::Status arrow::compute::internal::`anonymous-namespace'::ReplaceSubstring<arrow::LargeStringType,arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>>::Replace(arrow::compute::KernelContext *,const arrow::compute::ExecSpan &,const Replacer &,arrow::compute::ExecResult *)' being compiled [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]
          with
          [
              Replacer=arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>
          ] (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx)
D:\a\crossbow\crossbow\arrow\cpp\src\arrow/compute/kernels/codegen_internal.h(1249): message : see reference to class template instantiation 'arrow::compute::internal::`anonymous-namespace'::ReplaceSubstring<arrow::LargeStringType,arrow::compute::internal::`anonymous-namespace'::RegexSubstringReplacer<arrow::LargeStringType>>' being compiled (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx) [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]
D:/a/crossbow/crossbow/arrow/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc(2158): message : see reference to function template instantiation 'arrow::compute::ArrayKernelExec (__cdecl *arrow::compute::internal::GenerateVarBinaryToVarBinary<arrow::compute::internal::`anonymous-namespace'::ReplaceSubstringRegex,>(arrow::compute::internal::detail::GetTypeId))(arrow::compute::KernelContext *,const arrow::compute::ExecSpan &,arrow::compute::ExecResult *)' being compiled (compiling source file D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_21_cxx.cxx) [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\arrow_shared.vcxproj]

See: https://github.com/ursacomputing/crossbow/actions/runs/6533642461/job/17739225267

Component(s)

C++

@felipecrv felipecrv self-assigned this Oct 16, 2023
@felipecrv
Copy link
Contributor Author

@raulcd issue for the problem you reported. I'm pushing a fix.

@felipecrv felipecrv added this to the 14.0.0 milestone Oct 16, 2023
@raulcd raulcd added the Priority: Blocker Marks a blocker for the release label Oct 16, 2023
raulcd pushed a commit that referenced this issue Oct 16, 2023
…#38283)

### Rationale for this change

The type signature of `ReplaceString` should be identical when arrow is compiled with or without `ARROW_WITH_RE2`.

### What changes are included in this PR?

The right signature + delegating to the implementation that takes `re2::StringPiece`. The conversion should be a no-op when compiled and optimized.

### Are these changes tested?

By existing tests and CI checks.

* Closes: #38282

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
raulcd pushed a commit that referenced this issue Oct 16, 2023
…#38283)

### Rationale for this change

The type signature of `ReplaceString` should be identical when arrow is compiled with or without `ARROW_WITH_RE2`.

### What changes are included in this PR?

The right signature + delegating to the implementation that takes `re2::StringPiece`. The conversion should be a no-op when compiled and optimized.

### Are these changes tested?

By existing tests and CI checks.

* Closes: #38282

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
JerAguilon pushed a commit to JerAguilon/arrow that referenced this issue Oct 23, 2023
…nature (apache#38283)

### Rationale for this change

The type signature of `ReplaceString` should be identical when arrow is compiled with or without `ARROW_WITH_RE2`.

### What changes are included in this PR?

The right signature + delegating to the implementation that takes `re2::StringPiece`. The conversion should be a no-op when compiled and optimized.

### Are these changes tested?

By existing tests and CI checks.

* Closes: apache#38282

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this issue Nov 13, 2023
…nature (apache#38283)

### Rationale for this change

The type signature of `ReplaceString` should be identical when arrow is compiled with or without `ARROW_WITH_RE2`.

### What changes are included in this PR?

The right signature + delegating to the implementation that takes `re2::StringPiece`. The conversion should be a no-op when compiled and optimized.

### Are these changes tested?

By existing tests and CI checks.

* Closes: apache#38282

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
…nature (apache#38283)

### Rationale for this change

The type signature of `ReplaceString` should be identical when arrow is compiled with or without `ARROW_WITH_RE2`.

### What changes are included in this PR?

The right signature + delegating to the implementation that takes `re2::StringPiece`. The conversion should be a no-op when compiled and optimized.

### Are these changes tested?

By existing tests and CI checks.

* Closes: apache#38282

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants