Pin version of Rust required to 1.41+ #14

Open
opened 3 years ago by duke · 13 comments
duke commented 3 years ago
Owner

Not sure what happened but I get Rust errors in trying to compile latest dev:

   Compiling protobuf v2.10.1
   Compiling maybe-uninit v2.0.0
   Compiling backtrace-sys v0.1.32
   Compiling rand_jitter v0.1.4
error: `core::slice::<impl [T]>::len` is not yet stable as a const fn
   --> /home/duke/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.4/src/bytes.rs:130:18
    |
130 |             len: bytes.len(),
    |                  ^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `bytes`.
warning: build failed, waiting for other jobs to finish...
error: build failed
make[1]: *** [Makefile:22: target/release/silentdragonlite.a] Error 101

@jahway603 you have ideas about this?

Not sure what happened but I get Rust errors in trying to compile latest `dev`: ``` Compiling protobuf v2.10.1 Compiling maybe-uninit v2.0.0 Compiling backtrace-sys v0.1.32 Compiling rand_jitter v0.1.4 error: `core::slice::<impl [T]>::len` is not yet stable as a const fn --> /home/duke/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.4/src/bytes.rs:130:18 | 130 | len: bytes.len(), | ^^^^^^^^^^^ error: aborting due to previous error error: Could not compile `bytes`. warning: build failed, waiting for other jobs to finish... error: build failed make[1]: *** [Makefile:22: target/release/silentdragonlite.a] Error 101 ``` @jahway603 you have ideas about this?
Collaborator

bytes version 0.5.4 requires the latest version of Rust, 1.39.0 or later is needed, compiled successfully with rustc 1.49.0

bytes version 0.5.4 requires the latest version of Rust, 1.39.0 or later is needed, compiled successfully with rustc 1.49.0
Collaborator

@duke Just pulled fresh dev branch, compiled fine, and runs. I can't reproduce this error.

@onryo can you try compiling dev branch and see what result you get?

@duke Just pulled fresh dev branch, compiled fine, and runs. I can't reproduce this error. @onryo can you try compiling dev branch and see what result you get?
Collaborator

@jahway603 as I mentioned already, I compiled a dev branch with rustc 1.49.0, no errors

@jahway603 as I mentioned already, I compiled a dev branch with rustc 1.49.0, no errors
Collaborator

@onryo I apologize as I didn't see your "successful compile" message when I wrote mine on here. I'm also using rustc 1.49.0. I believe SDL has a specific rustc version pinned in it, so I don't believe it's using the system-installed rustc.

@onryo I apologize as I didn't see your "successful compile" message when I wrote mine on here. I'm also using rustc 1.49.0. I believe SDL has a specific rustc version pinned in it, so I don't believe it's using the system-installed rustc.
Poster
Owner

@onryo @jahway603 that is why I ask my question: Since SDL uses it's own pinned Rust, how is it possible to get this error?

@onryo @jahway603 that is why I ask my question: Since SDL uses it's own pinned Rust, how is it possible to get this error?
Poster
Owner

SDL does not have a pinned version of Rust, and it magically just worked on many of my machines, but not on a default Ubuntu 18.04 install @onryo @jahway603

SDL does not have a pinned version of Rust, and it magically just worked on many of my machines, but not on a default Ubuntu 18.04 install @onryo @jahway603
duke changed title from Compile error to Pin version of Rust required to 1.41+ 3 years ago
Collaborator

SDL does not have a pinned version of Rust, and it magically just worked on many of my machines, but not on a default Ubuntu 18.04 install @onryo @jahway603

I looked thru the Rust code when you initially reported this issue to try to find a pinned version, but was not sure if I missed it in there or not. When I was reading more about this topic, I learned that it was not good practice to pin a specific rust version but of course I can't find that article right now.

I always recommend people install the rustc/cargo provided by their OS package manager or to use rustup to use the latest rust version.

> SDL does not have a pinned version of Rust, and it magically just worked on many of my machines, but not on a default Ubuntu 18.04 install @onryo @jahway603 I looked thru the Rust code when you initially reported this issue to try to find a pinned version, but was not sure if I missed it in there or not. When I was reading more about this topic, I learned that it was not good practice to pin a specific rust version but of course I can't find that article right now. I always recommend people install the rustc/cargo provided by their OS package manager or to use rustup to use the latest rust version.
Poster
Owner

@jahway603 if we didn't pin our Rust version, stuff would be totally broken in hushd, since we use a very old Rust and they changed everything. SDL has less of an issue, since things haven't changed since Denio wrote the code. But most projects pin their version of Rust, such as Zcash, via "rustup" configs:

https://github.com/zcash/zcash/blob/master/rust-toolchain

@jahway603 if we didn't pin our Rust version, stuff would be totally broken in hushd, since we use a very old Rust and they changed everything. SDL has less of an issue, since things haven't changed since Denio wrote the code. But most projects pin their version of Rust, such as Zcash, via "rustup" configs: https://github.com/zcash/zcash/blob/master/rust-toolchain
Poster
Owner

I was able to compile SDL by using rustup and using the latest version of Rust, we could maybe try to add that to our build system. Currently, the default Rust of Ubuntu 18.04 does not work, and it sucks for people attempting to compile SDL. At the very least, our documentation needs big improvement.

We could also do a Docker container with everything exactly right, and I am leaning in that direction. We can take already existing ones like this, and tweak:

https://github.com/zcash/zcash/pull/4741/files

We already have a Dockerfile, so it's mostly taking some new good ideas from that PR and merging it into our existing Dockerfile, which is targeting 16.04 and probably doesn't work anymore, since it doesn't switch to gcc-7 for wolfssl

@jahway603

I was able to compile SDL by using `rustup` and using the latest version of Rust, we could maybe try to add that to our build system. Currently, the default Rust of Ubuntu 18.04 does not work, and it sucks for people attempting to compile SDL. At the very least, our documentation needs big improvement. We could also do a Docker container with everything exactly right, and I am leaning in that direction. We can take already existing ones like this, and tweak: https://github.com/zcash/zcash/pull/4741/files We already have a Dockerfile, so it's mostly taking some new good ideas from that PR and merging it into our existing Dockerfile, which is targeting 16.04 and probably doesn't work anymore, since it doesn't switch to gcc-7 for wolfssl @jahway603
Collaborator

I'm still trying to understand how the Docker stuff works syntax-wise.

I'm still trying to understand how the Docker stuff works syntax-wise.
Poster
Owner

@jahway603 docker build uses a Dockerfile to run a set of automated commands to make the container. It's like git with many subcommands, docker help should show help. I am saying this from memory, for some reason my version of docker is totally broken on Ubuntu

@jahway603 `docker build` uses a Dockerfile to run a set of automated commands to make the container. It's like git with many subcommands, `docker help` should show help. I am saying this from memory, for some reason my version of docker is totally broken on Ubuntu
Collaborator

@duke I've monkeyed with Docker before, so I have some basic familiarity with it. I mean the syntax in the actual Dockerfile is what I'm trying to become more familiar with now.

@duke I've monkeyed with Docker before, so I have some basic familiarity with it. I mean the syntax in the actual Dockerfile is what I'm trying to become more familiar with now.
Poster
Owner

@jahway603 it's shitty yet intuitive. There is also a competing thing called docker-compose which has a yaml file and can handle multiple containers in one file. It's less shitty and less intuitive to write the YAML, but better imho to maintain and use in production.

@jahway603 it's shitty yet intuitive. There is also a competing thing called `docker-compose` which has a yaml file and can handle multiple containers in one file. It's less shitty and less intuitive to write the YAML, but better imho to maintain and use in production.
onryo added the
build
label 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.