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

[Ruby] Cannot get gem installed on Ubuntu 20 with arrow 14,15 and/or 16 #41396

Closed
andresbarcenas opened this issue Apr 26, 2024 · 15 comments
Closed

Comments

@andresbarcenas
Copy link

andresbarcenas commented Apr 26, 2024

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

here is the error message on Ubuntu 20 (focal)

checking for arrow version (>= 15.0.0)... yes (16.0.0)
checking for arrow-glib version (>= 15.0.2)... yes (16.0.0)
creating Makefile

current directory: /home/deployer/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/red-arrow-15.0.2/ext/arrow
make "DESTDIR=" clean

current directory: /home/deployer/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/red-arrow-15.0.2/ext/arrow
make "DESTDIR="
compiling arrow.cpp
In file included from /usr/include/arrow/result.h:28,
                 from /usr/include/arrow/device.h:26,
                 from /usr/include/arrow/buffer.h:29,
                 from /usr/include/arrow/array/data.h:27,
                 from /usr/include/arrow/array/array_base.h:26,
                 from /usr/include/arrow/array.h:41,
                 from /usr/include/arrow/api.h:22,
                 from red-arrow.hpp:22,
                 from arrow.cpp:20:
/usr/include/arrow/util/aligned_storage.h:39:22: error: ‘constexpr const T* arrow::internal::AlignedStorage<T>::get() const’ cannot be overloaded with ‘constexpr T* arrow::internal::AlignedStorage<T>::get() const’
   39 |   constexpr const T* get() const noexcept {
      |                      ^~~
/usr/include/arrow/util/aligned_storage.h:35:16: note: previous declaration ‘constexpr T* arrow::internal::AlignedStorage<T>::get() const’
   35 |   constexpr T* get() noexcept {
      |                ^~~
In file included from /usr/include/arrow/device.h:26,
                 from /usr/include/arrow/buffer.h:29,
                 from /usr/include/arrow/array/data.h:27,
                 from /usr/include/arrow/array/array_base.h:26,

Is there any specific documentation/instructions to get this gem installed on Ubuntu 20. I was able to do it on CentOS7 with devtoolset-8

Component(s)

Ruby

@kou kou changed the title Cannot get gem installed on Ubuntu 20 with arrow 14,15 and/or 16 [Ruby] Cannot get gem installed on Ubuntu 20 with arrow 14,15 and/or 16 Apr 26, 2024
@kou
Copy link
Member

kou commented Apr 26, 2024

@raulcd msys2/MINGW-packages#20692 isn't merged yet but I'll release 16.0.0 gems. Because there is a problem with Apache Arrow C++ 16.0.0 and Red Arrow 15.0.x combination on other platforms. Releasing 16.0.0 gems break gem install red-arrow on Windows but it'll be fixed by msys2/MINGW-packages#20692 is merged.

@kou
Copy link
Member

kou commented Apr 26, 2024

I've released 16.0.0 gems.

@andresbarcenas Could you try again?

@raulcd
Copy link
Member

raulcd commented Apr 27, 2024

Thanks @kou , sounds good to me. I'll try to fix the MINGW packages PR tomorrow but I'm slightly busy might have to do it on Monday.

@kou
Copy link
Member

kou commented Apr 27, 2024

Thanks! No problem!

@Hronom
Copy link

Hronom commented Apr 29, 2024

Not works with 16.0.0, ruby 3.0.6. Docker image public.ecr.aws/docker/library/ruby:3.0.6-slim:

current directory: /usr/local/bundle/gems/red-arrow-16.0.0/ext/arrow
make DESTDIR\=
compiling arrow.cpp
In file included from /usr/include/arrow/result.h:28,
                 from /usr/include/arrow/device.h:26,
                 from /usr/include/arrow/buffer.h:29,
                 from /usr/include/arrow/array/data.h:27,
                 from /usr/include/arrow/array/array_base.h:26,
                 from /usr/include/arrow/array.h:41,
                 from /usr/include/arrow/api.h:22,
                 from red-arrow.hpp:22,
                 from arrow.cpp:20:
/usr/include/arrow/util/aligned_storage.h:39:22: error: ‘constexpr const T* arrow::internal::AlignedStorage<T>::get() const’ cannot be overloaded with ‘constexpr T* arrow::internal::AlignedStorage<T>::get() const’
   39 |   constexpr const T* get() const noexcept {
      |                      ^~~
/usr/include/arrow/util/aligned_storage.h:35:16: note: previous declaration ‘constexpr T* arrow::internal::AlignedStorage<T>::get() const’
   35 |   constexpr T* get() noexcept {
      |                ^~~
In file included from /usr/include/arrow/device.h:26,
                 from /usr/include/arrow/buffer.h:29,
                 from /usr/include/arrow/array/data.h:27,
                 from /usr/include/arrow/array/array_base.h:26,
                 from /usr/include/arrow/array.h:41,
                 from /usr/include/arrow/api.h:22,
                 from red-arrow.hpp:22,
                 from arrow.cpp:20:
/usr/include/arrow/result.h:423:16: error: ‘constexpr T& arrow::Result<T>::ValueUnsafe() const &’ cannot be overloaded with ‘constexpr const T& arrow::Result<T>::ValueUnsafe() const &’
  423 |   constexpr T& ValueUnsafe() & { return *storage_.get(); }
      |                ^~~~~~~~~~~
/usr/include/arrow/result.h:421:22: note: previous declaration ‘constexpr const T& arrow::Result<T>::ValueUnsafe() const &’
  421 |   constexpr const T& ValueUnsafe() const& { return *storage_.get(); }
      |                      ^~~~~~~~~~~

kind of blocker for usage of this lib.

@kou
Copy link
Member

kou commented Apr 29, 2024

Ah, re2.pc on Ubuntu 20.04 and Debian bullseye have -std=c++11. I assumed that re2.pc on all supported platforms don't have -std=c++11 in #39932.

Could you use Ubuntu 22.04 or ruby:*-bookworm instead?
Or could you run sudo sed -i -e 's/-std=c++11//g' /usr/lib/x86_64-linux-gnu/pkgconfig/re2.pc before gem install red-arrow as workaround?

@kou
Copy link
Member

kou commented Apr 29, 2024

FYI: sudo sed -i -e 's/-std=c++11//g' /usr/lib/x86_64-linux-gnu/pkgconfig/re2.pc is safe because g++ on Ubuntu 20.04 and Debian bullseye use C++14 as the default C++ standard.

@Hronom
Copy link

Hronom commented Apr 29, 2024

@kou thank you we cannot use bookworm as it will require update of Ruby. We currently use 3.0.6-slim-bullseye.

Strange issue, because previously it was working on the same version, but now it stopped. Is there was some update?

Trying to do:

sudo sed -i -e 's/-std=c++11//g' /usr/lib/x86_64-linux-gnu/pkgconfig/re2.pc

Will see if it break something

@andresbarcenas
Copy link
Author

andresbarcenas commented Apr 30, 2024

I've released 16.0.0 gems.

@andresbarcenas Could you try again?

I was able to do a simple 'gem install red-arrow -v 16' but I had to run the sudo sed -i -e 's/-std=c++11//g' /usr/lib/x86_64-linux-gnu/pkgconfig/re2.pc command as you mentioned.

Building native extensions. This could take a while...
Successfully installed red-arrow-16.0.0
Parsing documentation for red-arrow-16.0.0
Installing ri documentation for red-arrow-16.0.0
Done installing documentation for red-arrow after 1 seconds
1 gem installed

Thank you for such a fast update and releasing 16.0.0. gems

@kou
Copy link
Member

kou commented Apr 30, 2024

Yes. We need the sed on Ubuntu 20.04 too.

@kou
Copy link
Member

kou commented Apr 30, 2024

Is there was some update?

#39932 as I mentioned.

FYI: Debian GNU/Linux bullseye will reach EOL on 2024-07: https://wiki.debian.org/DebianReleases

So you need to update your image sooner or later.

@datbth
Copy link

datbth commented Aug 15, 2024

hi, is there any plan to make it work for Ubuntu 20 without the workaround?

kou added a commit to kou/arrow that referenced this issue Aug 16, 2024
Old re2.pc add "-std=c++11" but it causes a build error. Because
Apache Arrow C++ requires C++17.

We can remove "-std=c++11" as workaround.
@kou
Copy link
Member

kou commented Aug 16, 2024

I didn't have a plan for it because Ubuntu 20.04 will reach EOL soon but let's do it.

kou added a commit that referenced this issue Aug 16, 2024
### Rationale for this change

Old re2.pc add "-std=c++11" but it causes a build error. Because Apache Arrow C++ requires C++17.

### What changes are included in this PR?

Remove "-std=c++11" as workaround. We can remove this workaround when we drop support for Ubuntu 20.04.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* GitHub Issue: #41396

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 18.0.0 milestone Aug 16, 2024
@kou
Copy link
Member

kou commented Aug 16, 2024

Issue resolved by pull request 43721
#43721

@kou kou closed this as completed Aug 16, 2024
@datbth
Copy link

datbth commented Aug 16, 2024

That is really great. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants