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

Upgrade Rust dependencies and fix build errors #787

Closed
wants to merge 120 commits into from

Conversation

Mange
Copy link

@Mange Mange commented Feb 18, 2019

I cannot compile this on Arch Linux anymore (#778) because of a version of OpenSSL not supported by the current OpenSSL-dependent crates.

OpenSSL was depended on by hyper, which was depended on by reqwest. The latest version of reqwest pulls in a newer hyper, which has a lot of breaking changes because they removed most of the type-safe HTTP parts.
(I hear this is temporary)

Anyway, I've ported all build errors to the newer version of reqwest. Most of the changes are pretty much copied-pasted everywhere; I did not try to extract any patterns or utility functions as I didn't want to make any assumptions on how you want to design this.

Let me know if you want me to do more abstractions or reduce the code size.

@spk spk mentioned this pull request May 16, 2019
@Mange Mange mentioned this pull request Jun 8, 2019
@yuceltoluyag
Copy link

@Mange #811 there is a similar situation, will you apply correction

@Mange
Copy link
Author

Mange commented Feb 4, 2020

I could take another look when I get some time on my hands.

@Mange
Copy link
Author

Mange commented Feb 15, 2020

@Mange #811 there is a similar situation, will you apply correction

I don't have any errors compiling the Rust stuff in this branch. The AUR build is not using my branch, though.

This version had a lot of breaking changes in it, but is required in
order to compile on more recent OpenSSL versions.
@Mange
Copy link
Author

Mange commented Feb 15, 2020

Now it's just Python errors as far as I can see in the failing builds.
I've rebased this on top of the latest master, so it should be safe to merge and deal with the unrelated errors in another branch.

@dilyanpalauzov
Copy link
Contributor

With the above changes applied using Rust 1.42.0-dev I get these warnings:

running build
running build_py
copying vdirsyncer/version.py -> build/lib/vdirsyncer
   Compiling vdirsyncer-rustext v0.1.0 (/git/vdirsyncer/rust)
warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/dav/caldav.rs:69:47
   |
69 |     fn list<'a>(&'a mut self) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/dav/caldav.rs:170:55
    |
170 |     fn discover(config: Self::Config) -> Fallible<Box<Iterator<Item = Self::Config>>> {
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = Self::Config>`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/dav/carddav.rs:23:47
   |
23 |     fn list<'a>(&'a mut self) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/dav/carddav.rs:66:55
   |
66 |     fn discover(config: Self::Config) -> Fallible<Box<Iterator<Item = Self::Config>>> {
   |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = Self::Config>`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/dav/mod.rs:138:23
    |
138 |     ) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/dav/mod.rs:169:23
    |
169 |     ) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/dav/mod.rs:618:19
    |
618 |     ) -> *mut Box<Storage> {
    |                   ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/dav/mod.rs:648:19
    |
648 |     ) -> *mut Box<Storage> {
    |                   ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:16:68
   |
16 | pub unsafe extern "C" fn vdirsyncer_storage_free(storage: *mut Box<Storage>) {
   |                                                                    ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:17:20
   |
17 |     let _: Box<Box<Storage>> = Box::from_raw(storage);
   |                    ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:22:23
   |
22 |     storage: *mut Box<Storage>,
   |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:38:23
   |
38 |     storage: *mut Box<Storage>,
   |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:55:23
   |
55 |     storage: *mut Box<Storage>,
   |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:71:23
   |
71 |     storage: *mut Box<Storage>,
   |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/exports.rs:93:23
   |
93 |     storage: *mut Box<Storage>,
   |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/exports.rs:105:72
    |
105 | pub unsafe extern "C" fn vdirsyncer_storage_buffered(storage: *mut Box<Storage>) {
    |                                                                        ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/exports.rs:111:23
    |
111 |     storage: *mut Box<Storage>,
    |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/exports.rs:119:23
    |
119 |     storage: *mut Box<Storage>,
    |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/exports.rs:132:23
    |
132 |     storage: *mut Box<Storage>,
    |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/exports.rs:143:23
    |
143 |     storage: *mut Box<Storage>,
    |                       ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/exports.rs:150:19
    |
150 |     iterator: Box<Iterator<Item = (String, String)>>,
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)>`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/filesystem.rs:91:19
   |
91 |     ) -> *mut Box<Storage> {
   |                   ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/filesystem.rs:120:47
    |
120 |     fn list<'a>(&'a mut self) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/filesystem.rs:248:55
    |
248 |     fn discover(config: Self::Config) -> Fallible<Box<Iterator<Item = Self::Config>>> {
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = Self::Config>`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/http.rs:131:47
    |
131 |     fn list<'a>(&'a mut self) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/http.rs:188:19
    |
188 |     ) -> *mut Box<Storage> {
    |                   ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/singlefile.rs:83:90
   |
83 |     pub unsafe extern "C" fn vdirsyncer_init_singlefile(path: *const c_char) -> *mut Box<Storage> {
   |                                                                                          ^^^^^^^ help: use `dyn`: `dyn Storage`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/singlefile.rs:92:47
   |
92 |     fn list<'a>(&'a mut self) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>> {
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/storage/singlefile.rs:225:55
    |
225 |     fn discover(config: Self::Config) -> Fallible<Box<Iterator<Item = Self::Config>>> {
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = Self::Config>`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/mod.rs:32:55
   |
32 |     fn discover(config: Self::Config) -> Fallible<Box<Iterator<Item = Self::Config>>>;
   |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = Self::Config>`

warning: trait objects without an explicit `dyn` are deprecated
  --> src/storage/mod.rs:48:47
   |
48 |     fn list<'a>(&'a mut self) -> Fallible<Box<Iterator<Item = (String, String)> + 'a>>;
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = (String, String)> + 'a`

warning: use of deprecated item 'failure::core::str::<impl str>::trim_right_matches': superseded by `trim_end_matches`
  --> src/storage/dav/mod.rs:91:37
   |
91 |             url: format!("{}/", url.trim_right_matches('/')),
   |                                     ^^^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `trim_end_matches`
   |
   = note: `#[warn(deprecated)]` on by default

warning: unused boxed `std::iter::Iterator` trait object that must be used
   --> src/storage/http.rs:124:13
    |
124 |             self.list()?;
    |             ^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_must_use)]` on by default
    = note: iterators are lazy and do nothing unless consumed

warning: unused boxed `std::iter::Iterator` trait object that must be used
  --> src/storage/singlefile.rs:61:13
   |
61 |             self.list()?;
   |             ^^^^^^^^^^^^^
   |
   = note: iterators are lazy and do nothing unless consumed

    Finished release [optimized] target(s) in 34.74s
copying dylib libvdirsyncer_rustext.so
generating cffi module for 'vdirsyncer._native'
already up-to-date
generating wrapper for 'vdirsyncer._native'
running build_ext
building 'vdirsyncer._native__lib' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.6m -c build/temp.linux-x86_64-3.6/empty.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/empty.o
gcc -pthread -shared build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/empty.o -o /git/vdirsyncer/vdirsyncer/_native__lib.so

Copy link
Member

@WhyNotHugo WhyNotHugo left a comment

Choose a reason for hiding this comment

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

LGTM, though I'm not the Rust expert here.

@WhyNotHugo WhyNotHugo force-pushed the master branch 2 times, most recently from 47e2f6e to aafafaa Compare June 8, 2020 15:20
@WhyNotHugo
Copy link
Member

Thanks for your contribution, but we've rolled back the rust portion of the project. See #790 for futher details.

Closing since it's no longer applicable.

@WhyNotHugo WhyNotHugo closed this Jun 8, 2020
@Mange
Copy link
Author

Mange commented Jun 8, 2020

Understandable. Thank you for picking this up. ❤️

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.

None yet

9 participants