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

Build failing on latest nightly #1058

Closed
Bathtor opened this issue May 27, 2023 · 9 comments
Closed

Build failing on latest nightly #1058

Bathtor opened this issue May 27, 2023 · 9 comments

Comments

@Bathtor
Copy link

Bathtor commented May 27, 2023

It looks like the build is failing on rustc 1.71.0-nightly (1a5f8bce7 2023-05-26), because of an issue in the transitive value-bag dependency (via async-io):

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /Users/lkroll/.cargo/registry/src/index.crates.io-6f17d22bba15001f/value-bag-1.0.0-alpha.9/src/internal/cast/primitive.rs:43:33
   |
43 |                                   $const_ident => |v| Some(Internal::from(unsafe { &*(*v as *const Self as *const $ty) })),
   |                                   ^^^^^^^^^^^^
...
71 | /         to_internal![
72 | |             usize: (USIZE, OPTION_USIZE),
73 | |             u8: (U8, OPTION_U8),
74 | |             u16: (U16, OPTION_U16),
...  |
96 | |             String: (STRING, OPTION_STRING),
97 | |         ];
   | |_________- in this macro invocation
   |
   = note: the traits must be derived, manual `impl`s are not sufficient
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
   = note: this error originates in the macro `to_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /Users/lkroll/.cargo/registry/src/index.crates.io-6f17d22bba15001f/value-bag-1.0.0-alpha.9/src/internal/cast/primitive.rs:46:33
   |
46 |                                   $option_ident => |v| Some({
   |                                   ^^^^^^^^^^^^^
...
71 | /         to_internal![
72 | |             usize: (USIZE, OPTION_USIZE),
73 | |             u8: (U8, OPTION_U8),
74 | |             u16: (U16, OPTION_U16),
...  |
96 | |             String: (STRING, OPTION_STRING),
97 | |         ];
   | |_________- in this macro invocation
   |
   = note: the traits must be derived, manual `impl`s are not sufficient
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
   = note: this error originates in the macro `to_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /Users/lkroll/.cargo/registry/src/index.crates.io-6f17d22bba15001f/value-bag-1.0.0-alpha.9/src/internal/cast/primitive.rs:55:29
   |
55 |                               STR => |v| Some(Internal::from(unsafe { &**(v as *const &'a Self as *const &'a str) })),
   |                               ^^^
...
71 | /         to_internal![
72 | |             usize: (USIZE, OPTION_USIZE),
73 | |             u8: (U8, OPTION_U8),
74 | |             u16: (U16, OPTION_U16),
...  |
96 | |             String: (STRING, OPTION_STRING),
97 | |         ];
   | |_________- in this macro invocation
   |
   = note: the traits must be derived, manual `impl`s are not sufficient
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
   = note: this error originates in the macro `to_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `value-bag` (lib) due to 3 previous errors

Funny thing is: I can't reproduce this failure building either async-io or log (which is what pulls in value-bag) directly.
Anyone got any idea what's going on there?

@jbr
Copy link
Contributor

jbr commented May 27, 2023

Seems likely related to rust-lang/rust#103291, which just merged

@Bathtor
Copy link
Author

Bathtor commented May 27, 2023

Yup, but I don't understand why it's not failing when building async-io or log with the same Rust version. Only fails when building async-std and above (with default features so it pulls in async-io as a dependency).

@tan-wei
Copy link

tan-wei commented May 27, 2023

Got the same error. Seems caused by upstream.

@jbr
Copy link
Contributor

jbr commented May 27, 2023

You likely need to run cargo update to pick up log v0.4.7

@Bathtor
Copy link
Author

Bathtor commented May 27, 2023

Nope, it's already picking that up and the issue is till happening:

$ cargo tree | grep log
│   │   ├── log v0.4.17
│   │   │   └── log v0.4.17 (*)
│   │   └── log v0.4.17 (*)
├── kv-log-macro v1.0.7
│   └── log v0.4.17 (*)
├── log v0.4.17 (*)
│   ├── log v0.4.17 (*)

@Taaitaaiger
Copy link

I think it's only fixed in the master branch, log v0.4.17 depends on older version of value-bag: https://github.com/rust-lang/log/blob/7fb28c36c7a418912612ab37ab49bd4ca1a3a7f5/Cargo.toml#L66

@jbr
Copy link
Contributor

jbr commented May 28, 2023

I think it's only fixed in the master branch, log v0.4.17 depends on older version of value-bag: https://github.com/rust-lang/log/blob/7fb28c36c7a418912612ab37ab49bd4ca1a3a7f5/Cargo.toml#L66

Oh true! I thought 0.4.17 was earlier this month but it's a year old and there hasn't been a log release since then. Looks like the kv_unstable feature proved to be especially unstable

@Bathtor
Copy link
Author

Bathtor commented May 28, 2023

They released 0.4.18 a couple of hours ago, which fixes the issue.

@Bathtor
Copy link
Author

Bathtor commented May 28, 2023

I'm going to close this issue, then. Thanks everyone :)

@Bathtor Bathtor closed this as completed May 28, 2023
moore-ryan added a commit to moore-ryan/synth that referenced this issue Jun 4, 2023
Updating the version of the 'log' dependency to 0.4.18 to fix
compilation issues on recent Nightly toolchains.  See
async-rs/async-std#1058 for a similar issue.
iamwacko pushed a commit to shuttle-hq/synth that referenced this issue Jun 5, 2023
* fix: Fix panic on 'Nan' in csv_str_to_value

This fixes the panic that was thrown when csv_str_to_value attempted to
convert an 'invalid' float value into a JSON number. If the float value
was not representable as a JSON number, it would panic.
The new behaviour is to fall back to representing 'invalid' float values
as Strings, but still attempt to parse them as numbers first.

* chore: Update 'log' dep version to 0.4.18

Updating the version of the 'log' dependency to 0.4.18 to fix
compilation issues on recent Nightly toolchains.  See
async-rs/async-std#1058 for a similar issue.

* chore: Run rustfmt, add clippy allow

Ran rustfmt, there were some existing changes that ended up getting
reformatted.
Added an explicit `#[allow(clippy::default_constructed_unit_structs)]`
in `core/src/graph/number.rs` - `OsRng::default()` is used in a unit
test.
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