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

Cannot build with rustc 1.34 due to smallvec's use of unstable library #3192

Closed
dagonharett opened this issue Jan 15, 2020 · 9 comments
Closed

Comments

@dagonharett
Copy link

The build requirements list 1.34 as the minimum rust version required to build grin. Unfortunately current master (8568c77) can no longer be built with it.

Part of the issue was solved thanks to @cadwgan0 effort at #3190. Unfortunately some other issues remain, related to dependency libraries.

Building with rustc 1.37 works. However, keeping grin compatible with rustc 1.34 would be much handy for the time being, as that's the rust version available on Debian stable (Debian 10 buster).

Here follows the compile errors I get with rustc 1.34:

   Compiling smallvec v1.1.0
error[E0658]: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)
  --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:35:1
   |
35 | extern crate alloc;
   | ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
  --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:49:5
   |
49 | use core::mem::MaybeUninit;
   |     ^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:294:12
    |
294 |     Inline(MaybeUninit<A>),
    |            ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:315:28
    |
315 |     fn from_inline(inline: MaybeUninit<A>) -> SmallVecData<A> {
    |                            ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:319:36
    |
319 |     unsafe fn into_inline(self) -> MaybeUninit<A> {
    |                                    ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:394:45
    |
394 |             data: SmallVecData::from_inline(MaybeUninit::uninit()),
    |                                             ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:434:63
    |
434 |                 let mut data = SmallVecData::<A>::from_inline(MaybeUninit::uninit());
    |                                                               ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:470:45
    |
470 |             data: SmallVecData::from_inline(MaybeUninit::new(buf)),
    |                                             ^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:489:55
    |
489 |         unsafe { SmallVec::from_buf_and_len_unchecked(MaybeUninit::new(buf), len) }
    |                                                       ^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:508:51
    |
508 |     pub unsafe fn from_buf_and_len_unchecked(buf: MaybeUninit<A>, len: usize) -> SmallVec<A> {
    |                                                   ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:670:55
    |
670 |                 self.data = SmallVecData::from_inline(MaybeUninit::uninit());
    |                                                       ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:737:55
    |
737 |                 self.data = SmallVecData::from_inline(MaybeUninit::uninit());
    |                                                       ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
    --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:1078:52
     |
1078 |                     let mut data: MaybeUninit<A> = MaybeUninit::uninit();
     |                                                    ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
    --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:1078:35
     |
1078 |                     let mut data: MaybeUninit<A> = MaybeUninit::uninit();
     |                                   ^^^^^^^^^^^^^^

   Compiling remove_dir_all v0.5.2
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:303:42
    |
303 |             SmallVecData::Inline(a) => a.as_ptr() as *const A::Item,
    |                                          ^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:310:42
    |
310 |             SmallVecData::Inline(a) => a.as_mut_ptr() as *mut A::Item,
    |                                          ^^^^^^^^^^

error[E0599]: no function or associated item named `uninit` found for type `core::mem::MaybeUninit<_>` in the current scope
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:394:58
    |
394 |             data: SmallVecData::from_inline(MaybeUninit::uninit()),
    |                                             -------------^^^^^^
    |                                             |
    |                                             function or associated item not found in `core::mem::MaybeUninit<_>`

error[E0599]: no function or associated item named `uninit` found for type `core::mem::MaybeUninit<_>` in the current scope
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:434:76
    |
434 |                 let mut data = SmallVecData::<A>::from_inline(MaybeUninit::uninit());
    |                                                               -------------^^^^^^
    |                                                               |
    |                                                               function or associated item not found in `core::mem::MaybeUninit<_>`

error[E0599]: no function or associated item named `uninit` found for type `core::mem::MaybeUninit<_>` in the current scope
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:670:68
    |
670 |                 self.data = SmallVecData::from_inline(MaybeUninit::uninit());
    |                                                       -------------^^^^^^
    |                                                       |
    |                                                       function or associated item not found in `core::mem::MaybeUninit<_>`

error[E0599]: no function or associated item named `uninit` found for type `core::mem::MaybeUninit<_>` in the current scope
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:737:68
    |
737 |                 self.data = SmallVecData::from_inline(MaybeUninit::uninit());
    |                                                       -------------^^^^^^
    |                                                       |
    |                                                       function or associated item not found in `core::mem::MaybeUninit<_>`

   Compiling httparse v1.3.4
error[E0599]: no method named `assume_init` found for type `core::mem::MaybeUninit<A>` in the current scope
   --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:916:39
    |
916 |                 Ok(data.into_inline().assume_init())
    |                                       ^^^^^^^^^^^

error[E0599]: no function or associated item named `uninit` found for type `core::mem::MaybeUninit<_>` in the current scope
    --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:1078:65
     |
1078 |                     let mut data: MaybeUninit<A> = MaybeUninit::uninit();
     |                                                    -------------^^^^^^
     |                                                    |
     |                                                    function or associated item not found in `core::mem::MaybeUninit<_>`

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
    --> /home/dagon/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/smallvec-1.1.0/lib.rs:1081:30
     |
1081 |                         data.as_mut_ptr() as *mut A::Item,
     |                              ^^^^^^^^^^

error: aborting due to 23 previous errors

Some errors occurred: E0599, E0658.
For more information about an error, try `rustc --explain E0599`.
error: Could not compile `smallvec`.
warning: build failed, waiting for other jobs to finish...
error: build failed
@ghost
Copy link

ghost commented Jan 15, 2020

Looks like 1.36.0 is where the MaybeUninit API was stabilized: https://github.com/rust-lang/rust/blob/master/RELEASES.md this is probably why we get errors in 1.34.0 for these libs but not in 1.37.0. Looks like deprecation of uninitialized is set for 1.39.0.

@ghost
Copy link

ghost commented Jan 15, 2020

dep was introduced 9 hours ago via: c2026bd and we still have the other dep for smallvec 0.63 in cargo. Don't really have full context here and am a new contributor so think we will have to wait for @hashmap to comment

@quentinlesceller
Copy link
Member

quentinlesceller commented Jan 15, 2020

Not saying that it does not need to be reverted but why not install rust 1.40 on Debian with rustup (which is the recommended way)? @dagonharett

@dagonharett
Copy link
Author

@cadwgan0 Thanks a lot for looking into it.

@quentinlesceller On a system that must be maintained long-term, I try as much as I can to install all software through the distro's package manager. That way the origin of all files on disk is known and can be queried. Tasks like removing old unused software or freeing up disk space become much easier.
I need to run grin on a server that will be maintained long-term. Unfortunately the official grin binaries do not stick with plain x86_64 and come with some extra instructions that are illegal (i.e. not recognized) on the processor this server uses. Thus, I must build from source.

@hashmap
Copy link
Contributor

hashmap commented Jan 17, 2020

This is a good time to discuss should we introduce min supported version or not. So far it has been the latest stable, which was nice for devs, but not for users.
At the same time sticking with let’s say 1.34 would prevent us from all those async goodies.

@dagonharett
Copy link
Author

@hashmap Yes, having a clear policy on this would come handy.
For instance, I wouldn't get into contradictory info between what's in the build requirements and what actually works.

I would urge you to keep 1.34 for the time being, but well, that's only my use case.

@lehnberg
Copy link
Collaborator

Added as a discussion point to agenda of the Jan 21 dev meeting in Keybase #dev-channel:
mimblewimble/grin-pm#241

@lehnberg
Copy link
Collaborator

lehnberg commented Feb 4, 2020

Update from the meeting was a decision not to support a minimum version of rust (for now), rationale as per the meeting notes:
https://github.com/mimblewimble/grin-pm/blob/master/notes/20200121-meeting-development.md#8-add-min-supported-rust-version-or-not

Those who cannot use later versions of Rust to build their own binaries are encouraged to use pre-compiled binaries, with the sincere hope that this doesn't cause too many issues for users.

@dagonharett
Copy link
Author

Thanks for the update @lehnberg
As per that decision, this issue is no longer valid. Closing it.

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

No branches or pull requests

4 participants