Skip to content

Cryptography v36.0.2 w/ Rust#2378

Merged
hoodmane merged 83 commits intopyodide:mainfrom
hoodmane:rust-crypto
Jun 9, 2022
Merged

Cryptography v36.0.2 w/ Rust#2378
hoodmane merged 83 commits intopyodide:mainfrom
hoodmane:rust-crypto

Conversation

@hoodmane
Copy link
Member

@hoodmane hoodmane commented Apr 9, 2022

Resolves #1973.

@hoodmane
Copy link
Member Author

hoodmane commented Apr 9, 2022

@henryiii the code spell is trying to correct crate ==> create again

@hoodmane
Copy link
Member Author

hoodmane commented Apr 9, 2022

This is currently missing a fix for chronotope/chrono#519, but once we patch chrono it will work.

@henryiii
Copy link
Contributor

henryiii commented Apr 9, 2022

Again? We can add crate to the wordlist.

@henryiii
Copy link
Contributor

henryiii commented Apr 9, 2022

@hoodmane
Copy link
Member Author

hoodmane commented Jun 2, 2022

Okay I think this PR is in good shape now:

  1. I removed the need for -Zbuild-std so now we can build with rust stable
  2. Ideally RUSTFLAGS would use SIDE_MODULE_LDFLAGS but I can't get it to work
  3. The --whole-archive problem is recognized upstream, seems like it's just a matter of time before we work out an appropriate fix. --whole-archive causes trouble when linking rust emscripten-core/emscripten#17109
  4. The emscripten_get_now__sig patch is merged upstream https://github.com/emscripten-core/emscripten/pull/17123/files
  5. The chrono bug is fixed upstream, but we need them to make a release and cryptography to update the version before we can use it.
  6. The instant library looks unmaintained but I opened a PR emscripten_get_now should have no leading underscore sebcrozet/instant#47
  7. It would be fantastic to make rust emit .so files rather than emitting .wasm files and having to move them in pywasmcross, but the wasm32-unknown-emscripten target has "dll-suffix": ".wasm" and as far as I can tell this is not configurable without creating a custom target which would require us to maintain complete target metadata and would probably force us back to nightly rust.

@hoodmane
Copy link
Member Author

hoodmane commented Jun 2, 2022

So there is still a lot that could be improved but given the state of the wasm32-emscripten rust target, I would say we are doing pretty good here.

Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

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

Thanks for your hard work @hoodmane! It looks really cool.
Please update docs about the rust dependency that one should install rust to build cryptography (or when building with PYODIDE_PACKAGES="*" make)

(Probably in https://github.com/pyodide/pyodide/blob/main/docs/development/building-from-sources.md)

@hoodmane hoodmane mentioned this pull request Jun 7, 2022
2 tasks
@hoodmane
Copy link
Member Author

hoodmane commented Jun 7, 2022

Probably we should add Rust to the docker image?

@ryanking13
Copy link
Member

Probably we should add Rust to the docker image?

Yes I am +1 for it.

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

It would be good to update the documentation, otherwise LGTM as well.

@hoodmane
Copy link
Member Author

hoodmane commented Jun 8, 2022

I can't get the docker image to work correctly so I reverted that stuff. I think we can deal with that as a followup.

@ryanking13
Copy link
Member

Sure, feel free to merge it when you think it is ready. Thanks for your hard work!

@hoodmane hoodmane merged commit dbbbbb6 into pyodide:main Jun 9, 2022
@hoodmane hoodmane deleted the rust-crypto branch June 9, 2022 17:57
@hoodmane hoodmane mentioned this pull request Jun 9, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building a Python package that uses Rust

4 participants