Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Reduced dependencies from confi-table and enabled wasm on io_print feature. #276

Merged
merged 2 commits into from
Aug 11, 2021

Conversation

jorgecarleitao
Copy link
Owner

Hat tip to @roee88 for the ping :)

@jorgecarleitao jorgecarleitao added the enhancement An improvement to an existing feature label Aug 11, 2021
@codecov
Copy link

codecov bot commented Aug 11, 2021

Codecov Report

Merging #276 (39d5f60) into main (4c18c0a) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #276   +/-   ##
=======================================
  Coverage   77.14%   77.15%           
=======================================
  Files         254      254           
  Lines       20648    20648           
=======================================
+ Hits        15929    15931    +2     
+ Misses       4719     4717    -2     
Impacted Files Coverage Δ
src/compute/arithmetics/mod.rs 51.87% <0.00%> (+0.75%) ⬆️
src/compute/nullif.rs 1.81% <0.00%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c18c0a...39d5f60. Read the comment docs.

@@ -271,7 +271,7 @@ jobs:
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
# no need
cargo build --no-default-features --features=merge_sort,io_ipc,io_csv,io_json,io_parquet --target wasm32-unknown-unknown
cargo build --no-default-features --features=merge_sort,io_ipc,io_csv,io_print,io_json,io_parquet --target wasm32-unknown-unknown
Copy link

@roee88 roee88 Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt wasm32-unknown-unknown will work. Only wasm32-wasi works with stdio.
Edit: I stand corrected it seems to pass CI, no idea how but I'll check it later.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it worked :/

Copy link

@roee88 roee88 Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears like the approach in rust is to throw unsupported operation errors. See /~https://github.com/rust-lang/rust/tree/master/library/std/src/sys.

So it compiles but any code path that actually uses it will fail unless the user does some extra low level work (unlike in wasm32-wasi where it's actually implemented out of the box).

My personal opinion it that it's perfectly fine to just ensure that it compiles and users would need to ensure that their specific usage is using only valid execution paths. It's just that having this specific feature in the CI targeting wasm32-unknown-unknown might mislead users. That's minor though.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the investigation!

What is the specific path that would fail? the usage of println!?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I wrote a little sample and it all works perfectly fine:

  • The arrow2::io::print::write function works as expected
  • The arrow2::io::print::print function doesn't print anything in wasm32-unknown-unknown but it doesn't fail nor panics.

We're good here. Thanks for the opportunity to learn something new ;)

Copy link
Owner Author

@jorgecarleitao jorgecarleitao Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I really do not understand wasm, so every opportunity for a technical discussion about it is awesome :)

maybe we should deprecate arrow2::io::print::print, since it is basically just println!("{}", write(...)?), anyways.

@jorgecarleitao jorgecarleitao merged commit cacc4eb into main Aug 11, 2021
@jorgecarleitao jorgecarleitao deleted the reduce_dependencies branch August 11, 2021 20:01
@jorgecarleitao jorgecarleitao changed the title Reduce dependencies from confi-table and enable wasm on io_print feature. Reduced dependencies from confi-table and enabled wasm on io_print feature. Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants