-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: switch from extendr to the savvy framework #252
Conversation
Thanks for working on this! |
Thanks for the update! I have no idea why the build on Windows fails, but the error message refers to
|
Thanks for the quick glance! |
This comment was marked as resolved.
This comment was marked as resolved.
Here's what I found so far:
So, my guess is this is that how |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Maybe this? Swatinem/rust-cache#161 |
Ok, rerunning seems to have fixed the failure on Windows as well. It was probably a network error or something. |
Oh, curious. release-lib actions fail even without rust-cache? Then, my assumption might be wrong. |
Hmm, it seems that the method of copying the pre-built |
The R CMD check workflow on Windows now succeeds, so perhaps that was relevant. |
Thanks, it seems to matter, and probably release-lib is a different problem. Sorry, let me correct. I said
but, in the later section, it is actually included (cf. nm symbol both "U" and "T", what does that mean?). So, I think release-lib should succeed.
I thought I could reproduce the failure on my local by cp src/rust/target/x86_64-pc-windows-gnu/release/libprqlr.a tools/
cd src/rust && cargo clean
(build package) But, it doesn't fail. I'm wondering what's the difference. |
Thanks. |
Thanks, they are actually different. We are getting closer... GHA Windows:
local Windows:
|
I'll run checks on my repo and report here if it succeeds, so don't worry about the approval. 1st run (this should succeed as there's no cache for rust-cache): 2nd run: |
Ah, okay. I misunderstood about the meaning of
|
This should succeed. |
Seems passed all the tests, thank you for the awesome work! I would like to check it works locally and merge it within a few days. |
Thanks. The last problem was that I forgot the absence of Please let me know if you find any problem on your local! |
It seems that pre-built binary is working fine on arm64 Linux! root ➜ /tmp $ export NOT_CRAN=true
root ➜ /tmp $ export LIBPRQLR_PATH=/tmp/libprqlr.a
root ➜ /tmp $ radian
R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
Platform: aarch64-unknown-linux-gnu (64-bit)
r$> remotes::install_github("eitsupi/prqlr#252")
Downloading GitHub repo yutannihilation/prqlr@savvy
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/RtmpkPtlZk/remotes86429df08f/yutannihilation-prqlr-5f38e75/DESCRIPTION’ (675ms)
─ preparing ‘prqlr’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘prqlr_0.7.0.9000.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘prqlr’ ...
** using staged installation
---------------------- [LIBRARY BINARY FOUND] ----------------------
The library was found at </tmp/libprqlr.a>. No need to build it.
--------------------------------------------------------------------
------------------------ [COPYING BINARY] ------------------------
Copying </tmp/libprqlr.a> to </tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/tools/libprqlr.a>.
------------------------------------------------------------------
** libs
rm -Rf "prqlr.so" "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target//release/libprqlr.a" "init.o"
gcc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
if [ -f "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/../tools/libprqlr.a" ]; then \
mkdir -p "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target//release" ; \
mv "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/../tools/libprqlr.a" "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target//release/libprqlr.a" ; \
exit 0; \
fi && \
if [ -f "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/vendor.tar.xz" ]; then \
mkdir -p "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/vendor" && \
/usr/bin/tar --extract --xz --file "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/vendor.tar.xz" -C "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/vendor" && \
mkdir -p "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/.cargo" && \
cp "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/vendor-config.toml" "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/.cargo/config.toml"; \
fi && \
if [ "true" != "true" ]; then \
export CARGO_HOME="/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/.cargo"; \
export CARGO_BUILD_JOBS=2; \
fi && \
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin" && \
if [ "" != "wasm32-unknown-emscripten" ]; then \
cargo build --lib --manifest-path="/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/Cargo.toml" --target-dir "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target" --target="" \
--profile="release" --features=""; \
else \
export CC="gcc" && \
export CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g " && \
export CARGO_PROFILE_RELEASE_PANIC="abort" && \
cargo +nightly build --lib --manifest-path="/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/Cargo.toml" --target-dir "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target" --target="" \
--profile="release" --features="" -Zbuild-std=panic_abort,std; \
fi
if [ "true" != "true" ]; then \
rm -Rf "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/.cargo" "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/vendor" "/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target//release/build"; \
fi
gcc -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o prqlr.so init.o -L/tmp/RtmpCbxnGA/R.INSTALL1401a6291ed/prqlr/src/rust/target//release -lprqlr -L/usr/local/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-prqlr/00new/prqlr/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (prqlr)
r$> library(prqlr)
"from mtcars | filter cyl > 6 | select {cyl, mpg}" |>
prql_compile() |>
cat()
SELECT
cyl,
mpg
FROM
mtcars
WHERE
cyl > 6
-- Generated by PRQL compiler version:0.11.1 (https://prql-lang.org) Let's merging this. |
Thank you! |
It looks like the wasm build on R-universe is failing (Not only this package). Perhaps we need to open an issue in the webR repository and update the Dockerfile for the container image used for the build? |
Ah, yes, they are not ready for Rust yet. Sorry I didn't share it clearly. This is the relevant discussion: |
Thank you. I'm concerned about increasing the image size, but I think it would be great if Rust was added to the base image. |
Just for sharing. I understood the problem a bit wrong. In the case of R-universe, cargo is installed by these lines: However, since it's installed via
But, as it turned out adding Rust is not very lightweight (my comment), I think R-universe's way, installing it only when it's needed, is appropriate. I'll try proposing some better handling of Rust toolchain to edit: Wait, it seems I'm looking at wrong lines. Hmm...
|
This is a proof of concept of migration from the extendr framework to the savvy framework. The bonus is that you can compile the package for webR. But, there are some caveats.
Option
as the argument, so you have to handle it on R's side.