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

prqlr fails to compile on Linux arm64 #88

Closed
andresrcs opened this issue Feb 20, 2023 · 20 comments · Fixed by #90
Closed

prqlr fails to compile on Linux arm64 #88

andresrcs opened this issue Feb 20, 2023 · 20 comments · Fixed by #90
Labels
bug Something isn't working upstream
Milestone

Comments

@andresrcs
Copy link

andresrcs commented Feb 20, 2023

prqlr complains about the Rust version that comes from the OS repositories on Debian-based distros (tried with Ubuntu 22.04 LTS and RPi OS) but even after installing the latest Rust version with rustup (which solves the problem for Linux amd64) compilation still fails on arm64 with this error message.

 --- stderr
  thread 'main' panicked at 'Cannot find libR-sys bindings file for R 4.2.2false on linux in bindings. Consider compiling with --features use-bindgen.', /tmp/RtmpjWO0lb/R.INSTALL463401756134e/prqlr/src/.cargo/registry/src/github.com-1ecc6299db9ec823/libR-sys-0.3.0/build.rs:448:13
@eitsupi
Copy link
Member

eitsupi commented Feb 20, 2023

Thank your for letting me know about that!

I believe this is actually an extendr issue, since this package does not use libR-sys directly.
What happens if you install another package that uses extendr, like https://github.com/extendr/helloextendr? (sorry, I can't try this right now)

@eitsupi eitsupi added bug Something isn't working upstream labels Feb 20, 2023
@andresrcs
Copy link
Author

andresrcs commented Feb 20, 2023

What happens if you install another package that uses extendr, like https://github.com/extendr/helloextendr? (sorry, I can't try this right now)

Sadly, I get the same error message. My hope was that compilation options for cargo were set by you and you could simply add --features use-bindgen to the Makevars file.

@eitsupi
Copy link
Member

eitsupi commented Feb 21, 2023

Those files come from rextendr.
Could you please create an issue on rextendr or libR-sys?

@andresrcs
Copy link
Author

The problem is both rextender and libR-sys (even with --features use-bindgen) compile just fine on arm64 so I don't know on what basis I can open an issue there since I'm not familiar with the Rust language.

@eitsupi
Copy link
Member

eitsupi commented Feb 22, 2023

I created a PR to add libR-sys bindings for linux/arm64 (extendr/libR-sys#133)

@eitsupi eitsupi added this to the v0.2.1 milestone Feb 22, 2023
@andresrcs
Copy link
Author

andresrcs commented Feb 26, 2023

The new libR-sys 0.4.0 release, which includes the aarch64 bindings, is available now but when installing prqlr it keeps downloading version 0.3.0. I guess this comes from rextendr?

@eitsupi
Copy link
Member

eitsupi commented Feb 26, 2023

The version of extendr is fixed here. This needs to be updated.

https://github.com/eitsupi/prqlr/blob/0d315ec23e5545e8989532c598c02110e1451a57/src/rust/Cargo.toml#L13

@eitsupi
Copy link
Member

eitsupi commented Feb 26, 2023

It appears that extendr 0.4.0 has not yet been released to crates.io.
https://crates.io/crates/extendr-api

@eitsupi
Copy link
Member

eitsupi commented Feb 26, 2023

#90 should allow installation on arm64 Linux.

eitsupi added a commit that referenced this issue Feb 26, 2023
#90)

This version of extendr-api contains arm64 Linux support.

Fix #88
@andresrcs
Copy link
Author

I tested it on RPi OS, and it is working great!
Do you have an estimate for a CRAN release? I would like to have this added to the R4Pi project to have a binary for RPi OS

@eitsupi
Copy link
Member

eitsupi commented Feb 26, 2023

Do you have an estimate for a CRAN release? I would like to have this added to the R4Pi project to have a binary for RPi OS

Wow, that's fantastic!
This is a serious bug fix and I will try to submit it to CRAN in the next few days.

@eitsupi
Copy link
Member

eitsupi commented Feb 28, 2023

prqlr 0.2.1 is now on CRAN.

@andresrcs
Copy link
Author

Now compilation fails on RPi OS because of the cargo version

cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir ./rust/target error: failed to parse manifest at `/tmp/RtmpO4x1Jc/R.INSTALL1806e2c2bf6d7/prqlr/src/rust/Cargo.toml` Caused by: failed to parse the `edition` key Caused by: this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions. make: *** [Makevars:16: rust/target/release/libprqlr.a] Error 101 ERROR: compilation failed for package ‘prqlr’

It would be possible for you to lower the version requirement?

@eitsupi
Copy link
Member

eitsupi commented Feb 28, 2023

Now compilation fails on RPi OS because of the cargo version

cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir ./rust/target error: failed to parse manifest at `/tmp/RtmpO4x1Jc/R.INSTALL1806e2c2bf6d7/prqlr/src/rust/Cargo.toml` Caused by: failed to parse the `edition` key Caused by: this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions. make: *** [Makevars:16: rust/target/release/libprqlr.a] Error 101 ERROR: compilation failed for package ‘prqlr’

It would be possible for you to lower the version requirement?

The version of Rust is too old (older than 1.56 !?).
It is not possible to support that version because many dependent packages do not support it.

The Rust version of Debian stable is too old, so if you install it with apt, you will need to install from testing at least.

@andresrcs
Copy link
Author

andresrcs commented Feb 28, 2023

I see, I'll try to convince Mark (from R4Pi) to install Rust with rustup.

rustup installs per user and when I used prqlr on RStudio with my personal user rather than Pi, it worked normally. As far as I can tell, once the package is installed an up to date Rust version is no longer required right?

@eitsupi
Copy link
Member

eitsupi commented Feb 28, 2023

I see, I'll try to convince Mark (from R4Pi) to install Rust with rustup.

Thank you for doing this. The Rust version of Debian stable is really too old... (See #49)
Ubuntu is currently 1.61, which is much newer than Debian stable, but still quite old and prql-compiler cannot be installed.

I am currently continuing to patch prql-compiler with every release of prqlr to make it buildable on older Rust versions.......

rustup installs per user and when I used prqlr on RStudio with my personal user rather than Pi, it worked normally. As far as I can tell, once the package is installed an up to date Rust version is no longer required right?

Yes, it is required at source code build time.

@andresrcs
Copy link
Author

FYI, a binary for aarch64 is available now in the R4Pi package repository.

It took a little while because we had to figure out some infrastructure management issues to make sure Rust can be installed consistently in the builder server without manual intervention.

@eitsupi
Copy link
Member

eitsupi commented Mar 10, 2023

@andresrcs Awesome! Thank you for working on that!

@eitsupi
Copy link
Member

eitsupi commented Oct 9, 2023

@andresrcs FYI, prqlr can be source install without Rust now.
If you don't mind using pre-built binaries, you should be able to get a fast install on the Raspberry Pi by trying something like the following, as described in the README.

Sys.setenv(NOT_CRAN = "true")
install.packages("prqlr")

@andresrcs
Copy link
Author

Thanks for the heads up. I do not compile prqlr on the Pi any more since I use the R4Pi project for binaries but I'll let them know Rust is no longer mandatory for the building tool chain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants