Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

starlark-rust doesn't build #266

Closed
alandonovan opened this issue Mar 29, 2020 · 6 comments
Closed

starlark-rust doesn't build #266

alandonovan opened this issue Mar 29, 2020 · 6 comments

Comments

@alandonovan
Copy link

I assume I'm holding it wrong, but the documentation doesn't tell me how to hold it right.

$ uname -a 
Linux xxx 5.2.17-1rodete3-amd64 #1 SMP Debian 5.2.17-1rodete3 (2019-10-21 > 2018) x86_64 GNU/Linux
$ date
Sun 29 Mar 2020 01:03:20 PM EDT
$ mkdir  /tmp/foo
$ cd /tmp/foo
$ git clone https://github.com/google/starlark-rust
...
Unpacking cargo (0.37.0-3) ...
...

$ cd starlark-rust/
$ cargo run  --example starlark-simple-cli
    Updating crates.io index
   Compiling libc v0.2.68
   Compiling autocfg v0.1.7
   Compiling rand_core v0.4.2
   Compiling proc-macro2 v1.0.9
   Compiling unicode-xid v0.2.0
   Compiling siphasher v0.2.3
   Compiling typenum v1.11.2
   Compiling syn v1.0.17
   Compiling memchr v2.3.3
   Compiling string_cache_shared v0.3.0
   Compiling byteorder v1.3.4
   Compiling log v0.4.8
   Compiling lazy_static v1.4.0
   Compiling serde v1.0.105
   Compiling byte-tools v0.3.1
   Compiling regex-syntax v0.6.17
   Compiling cfg-if v0.1.10
   Compiling ordermap v0.3.5
   Compiling either v1.5.3
   Compiling fixedbitset v0.1.9
   Compiling precomputed-hash v0.1.1
   Compiling bit-vec v0.5.1
   Compiling new_debug_unreachable v1.0.4
   Compiling fake-simd v0.1.2
   Compiling opaque-debug v0.2.3
   Compiling term v0.4.6
   Compiling strsim v0.9.3
   Compiling diff v0.1.12
   Compiling lalrpop-util v0.16.3
   Compiling unicode-xid v0.1.0
   Compiling codemap v0.1.2
   Compiling termcolor v1.1.0
   Compiling linked-hash-map v0.5.2
   Compiling thread_local v1.0.1
   Compiling block-padding v0.1.5
   Compiling phf_shared v0.7.24
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling itertools v0.8.2
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling bit-set v0.5.1
   Compiling petgraph v0.4.13
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling ena v0.11.0
   Compiling aho-corasick v0.7.10
   Compiling rand_os v0.1.3
   Compiling atty v0.2.14
   Compiling codemap-diagnostic v0.1.1
   Compiling generic-array v0.12.3
   Compiling ascii-canvas v1.0.0
   Compiling quote v1.0.3
   Compiling digest v0.8.1
   Compiling block-buffer v0.7.3
   Compiling sha2 v0.8.1
   Compiling phf_generator v0.7.24
   Compiling string_cache_codegen v0.4.4
   Compiling string_cache v0.7.5
   Compiling regex v1.3.6
   Compiling serde_derive v1.0.105
   Compiling docopt v1.1.0
   Compiling lalrpop v0.16.3
   Compiling starlark v0.3.1-pre (/tmp/foo/starlark-rust/starlark)
error[E0432]: unresolved import `std::any::type_name`
  --> starlark/src/values/mod.rs:94:5
   |
94 | use std::any::type_name;
   |     ^^^^^^^^^^^^^^^^^^^ no `type_name` in `any`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `starlark`.

To learn more, run the command again with --verbose.

$
@illicitonion
Copy link
Contributor

Looks like you're using rust 1.37 and we have a minimum supported version of 1.38 due to changes in the standard library:

dwh@chopin:~/src/github.com/google/starlark-rust$ cargo +1.38.0 build
   Compiling structopt-derive v0.3.5
   Compiling mortal v0.1.5
   Compiling starlark v0.3.1-pre (/home/dwh/src/github.com/google/starlark-rust/starlark)
   Compiling linefeed v0.5.4
   Compiling structopt v0.3.5
error: `std::string::String::new` is not yet stable as a const fn
  --> starlark/src/values/string/rc.rs:55:31
   |
55 | static EMPTY_STRING: String = String::new();
   |                               ^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `starlark`.

To learn more, run the command again with --verbose.
dwh@chopin:~/src/github.com/google/starlark-rust$ cargo +1.39.0 build
   Compiling starlark-test v0.0.0 (/home/dwh/src/github.com/google/starlark-rust/starlark-test)
   Compiling starlark-repl v0.3.1-pre (/home/dwh/src/github.com/google/starlark-rust/starlark-repl)
    Finished dev [unoptimized + debuginfo] target(s) in 4.69s

@alandonovan
Copy link
Author

Thanks, I figured out a way to make it build, but the documentation should have told me exactly what to do.

@damienmg
Copy link
Member

The version of rust is already 6 months old https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1390-2019-11-07.

This is questionable if this is part of the documentation, this will quickly becomes out of date. Maybe we can add a check that would output a better error message? Seems like it should be doable soonish: rust-lang/rfcs#2495

@alandonovan
Copy link
Author

alandonovan commented Mar 31, 2020

If you want more users, then your project's main page should show the commands needed to install the project onto a typical machine, stating any toolchain version requirements and how to verify them.

May I humbly suggest as an example: https://github.com/google/starlark-go#getting-started

If you don't want more users, you can do whatever you want. ;)

@damienmg
Copy link
Member

Our users are rust developers and yourself :)

Anyhow I am not suggesting to not mark it. We have a section about building the code, which happens to be wrong in one case. Your document does not include the version of the go toolchain you need to install either, this is what I think should be maintained, if we can specify the rust toolchain in the cargo manifest, this is a way better approach IMO.

@alandonovan
Copy link
Author

alandonovan commented Mar 31, 2020

Your document does not include the version of the go toolchain you need to install

True, but that's because it works with the last releases of Go (and probably many more), which means in practice it just works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants