-
Notifications
You must be signed in to change notification settings - Fork 815
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
Update rand, proc-macro and zstd dependencies #488
Conversation
Codecov Report
@@ Coverage Diff @@
## master #488 +/- ##
=========================================
Coverage 82.53% 82.54%
=========================================
Files 162 167 +5
Lines 43786 45957 +2171
=========================================
+ Hits 36140 37934 +1794
- Misses 7646 8023 +377
Continue to review full report at Codecov.
|
arrow/Cargo.toml
Outdated
@@ -60,6 +63,8 @@ csv = ["csv_crate"] | |||
ipc = ["flatbuffers"] | |||
simd = ["packed_simd"] | |||
prettyprint = ["prettytable-rs"] | |||
# enable features that rely on std | |||
std = ["rand/std", "rand/std_rng"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this one -- I needed to conditionally pull in the rand
crate features that rely on std
as it is needed for the arrow-pyarrow-integration-testing
-- something about how maturin
builds arrow requires the std features of rand (seems to build the tests as well)
However, if we use the default features of rand then we can't build for wasm anymore 🤔
@jorgecarleitao I am not sure if you have any thoughts
I think technically this is an API change so marking it as such (and meaning we probably should not include it in the arrow 4.x line, but wait for the 5.0 release) |
I actually think the way cargo versions work, this is not a api change (as cargo will use an older version of the 4.x line if it can't pick a compatible version of these crates |
@jorgecarleitao I would like to merge this PR in for the 5.0 release -- could you possibly review the changes needed for |
d4eb088
to
facd201
Compare
@@ -31,7 +31,7 @@ name = "arrow_pyarrow_integration_testing" | |||
crate-type = ["cdylib"] | |||
|
|||
[dependencies] | |||
arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT" } | |||
arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT", features=["std"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was required for some reason otherwise the python integration build failed with errors about not being able to find the rng that requires std
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the rand
release complicated a bit our side. I would also be fine with keeping the 0.8 (i.e. not bump up for now).
Regardless, all great stuff 👍
rand = { version = "0.8", default-features = false } | ||
# getrandom is a dependency of rand, not (directly) of arrow | ||
# need to specify `js` feature to build on wasm | ||
getrandom = { version = "0.2", features = ["js"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may be able to achieve the same using rand
with feature getrandom/js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will give it a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and sadly I am told:
alamb@ip-10-0-0-124:~/Software/arrow-rs/arrow$ cargo build --target wasm32-unknown-unknown
error: failed to parse manifest at `/Users/alamb/Software/arrow-rs/arrow/Cargo.toml`
Caused by:
feature `getrandom/js` in dependency `rand` is not allowed to contain slashes
If you want to enable features of a transitive dependency, the direct dependency needs to re-export those features from the `[features]` table.
alamb@ip-10-0-0-124:~/Software/arrow-rs/arrow$ git diff Cargo.toml
diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml
index 478f33678..f6255a93d 100644
--- a/arrow/Cargo.toml
+++ b/arrow/Cargo.toml
@@ -40,10 +40,7 @@ serde = { version = "1.0", features = ["rc"] }
serde_derive = "1.0"
serde_json = { version = "1.0", features = ["preserve_order"] }
indexmap = "1.6"
-rand = { version = "0.8", default-features = false }
-# getrandom is a dependency of rand, not (directly) of arrow
-# need to specify `js` feature to build on wasm
-getrandom = { version = "0.2", features = ["js"] }
+rand = { version = "0.8", default-features = false, features = ["getrandom/js"] }
num = "0.4"
csv_crate = { version = "1.1", optional = true, package="csv" }
regex = "1.3"
alamb@ip-10-0-0-124:~/Software/arrow-rs/arrow$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, it appears this workaround is the recommended way from rand
rate: https://crates.io/crates/rand
WASM support
The WASM target wasm32-unknown-unknown is not automatically supported by rand or getrandom. To solve this, either use a different target such as wasm32-wasi or add a direct dependancy on getrandom with the js feature (if the target supports JavaScript). See getrandom#WebAssembly support.
facd201
to
a02580a
Compare
@@ -40,7 +40,10 @@ serde = { version = "1.0", features = ["rc"] } | |||
serde_derive = "1.0" | |||
serde_json = { version = "1.0", features = ["preserve_order"] } | |||
indexmap = "1.6" | |||
rand = "0.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I removed the wacky std
feature and found a different work around for arrow-pyarrow-integration-testing
If this passes CI I think it is good enough to merge
a02580a
to
6ccb25a
Compare
Rationale for this change
Keep arrow up to date with rust cargo ecosystem
What changes are included in this PR?
Are there any user-facing changes?
Dependencies change