CosmWasm / cw-template

Quickstart template to get started writing your own cosmwasm contracts
Apache License 2.0
287 stars 172 forks source link

default CI failing for project using `cargo generate` #68

Closed anupam-io closed 3 years ago

anupam-io commented 3 years ago

Is the CI supposed to be failing, when we create a new project using cargo generate --git https://github.com/CosmWasm/cosmwasm-template.git --name PROJECT_NAME?

Test-suite fail:

Run actions-rs/cargo@v1
  with:
    command: unit-test
    args: --locked
    use-cross: false
  env:
    RUST_BACKTRACE: 1
/usr/share/rust/.cargo/bin/cargo unit-test --locked
    Updating crates.io index
error: the lock file /home/runner/work/tenaroll/tenaroll/Cargo.lock needs to be updated but --locked was passed to prevent this
Error: If you want to try to generate the lock file without accessing the network, use the --offline flag.
Error: The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 101

Lints fail

Run actions-rs/cargo@v1
/usr/share/rust/.cargo/bin/cargo clippy -- -D warnings
   Compiling proc-macro2 v1.0.26
   Compiling typenum v1.13.0
   Compiling unicode-xid v0.2.2
   Compiling version_check v0.9.3
   Compiling syn v1.0.72
   Compiling libc v0.2.94
    Checking cfg-if v1.0.0
   Compiling getrandom v0.1.16
    Checking subtle v2.4.0
   Compiling serde_derive v1.0.126
   Compiling serde v1.0.126
    Checking funty v1.1.0
    Checking radium v0.3.0
    Checking wyz v0.2.0
    Checking zeroize v1.3.0
    Checking const-oid v0.4.5
error[E0658]: `if` is not allowed in a `const fn`
Error:    --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/lib.rs:126:21
    |
126 | /                     if arcs.len() > $n {
127 | |                         encoder = encoder.encode(arcs[$n]);
128 | |                     }
    | |_____________________^
...
133 |           encode_arc!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
    |           -------------------------------------------------- in this macro invocation
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `match` is not allowed in a `const fn`
Error:    --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/encoder.rs:102:5
    |
102 | /     match index {
103 | |         4 => 3,
104 | |         3 => 2,
105 | |         2 => 1,
...   |
110 | |         }
111 | |     }
    | |_____^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `match` is not allowed in a `const fn`
Error:    --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/encoder.rs:116:5
    |
116 | /     match arc {
117 | |         0..=0x7f => 0,
118 | |         0x80..=0x3fff => 1,
119 | |         0x4000..=0x1fffff => 2,
120 | |         0x200000..=0x1fffffff => 3,
121 | |         _ => 4,
122 | |     }
    | |_____^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `match` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/encoder.rs:44:9
   |
44 | /         match self.state {
45 | |             State::Initial => {
46 | |                 const_assert!(arc <= FIRST_ARC_MAX, "invalid first arc (must be 0-2)");
47 | |                 self.state = State::FirstArc(arc);
...  |
70 | |             }
71 | |         }
   | |_________^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `if` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/encoder.rs:85:20
   |
85 |         let mask = if continued { 0b10000000 } else { 0 };
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `if` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/encoder.rs:87:9
   |
87 | /         if n > 0x80 {
88 | |             self.bytes[self.cursor + i] = (n & 0b1111111) as u8 | mask;
89 | |             n >>= 7;
90 | |
...  |
95 | |             self
96 | |         }
   | |_________^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `match` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/parser.rs:78:5
   |
78 | /     match char {
79 | |         b'0' => 0,
80 | |         b'1' => 1,
81 | |         b'2' => 2,
...  |
92 | |         }
93 | |     }
   | |_____^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `match` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/parser.rs:90:27
   |
90 |             const_assert!(matches!(other, b'0'..=b'9'), "invalid ASCII digit");
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `match` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/parser.rs:22:13
   |
22 |             matches!(bytes[0], b'0'..=b'9'),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `match` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/parser.rs:42:9
   |
42 | /         match bytes {
43 | |             [] => {
44 | |                 self.encoder = self.encoder.encode(self.current_arc);
45 | |                 self
...  |
70 | |             }
71 | |         }
   | |_________^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `match` is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/parser.rs:63:21
   |
63 |                     matches!(byte, b'0'..=b'9' | b'.'),
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: or-pattern is not allowed in a `const fn`
Error:   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/const-oid-0.4.5/src/parser.rs:63:21
   |
63 |                     matches!(byte, b'0'..=b'9' | b'.'),
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 12 previous errors
Error: aborting due to 12 previous errors
For more information about this error, try `rustc --explain E0658`.
error: could not compile `const-oid`.
Error: could not compile `const-oid`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
Warning: error: build failed
Error: The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 101
webmaster128 commented 3 years ago

Which version of Rust are you using? CosmWasm 0.14 (current stable) requires 1.51.0.

webmaster128 commented 3 years ago

Oh, we still have 1.44.1 in the CI config files. That is outdated, sorry. You can change 1.44.1 -> 1.51.0 in your project which most likely will fix the issue.

ethanfrey commented 3 years ago

We also need to re-generate the schema files for the linter.

I will make both updates.