[Bug 271358] Mk/Uses/cargo.mk: [workspace.dependencies] breaks CARGO_INSTALL_PATH

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 11 May 2023 03:18:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271358

            Bug ID: 271358
           Summary: Mk/Uses/cargo.mk: [workspace.dependencies] breaks
                    CARGO_INSTALL_PATH
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: needs-patch
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: rust@FreeBSD.org
          Reporter: jbeich@FreeBSD.org
                CC: ports-bugs@FreeBSD.org

Cargo workspaces don't yet support top-level "cargo install" but with
[workspace.dependencies] creates a feature desync between top-level and subdir
build. Unfortunately, cargo (unlike cargo-c) doesn't support --package in
"install" subcommand in order to avoid unnecessary rebuild.

$ cd games/veloren-weekly
$ sed -i '' '/do-install:/,/^$/d' Makefile
$ make restage
[...]
=======================<phase: stage          >============================
[...]
error[E0277]: the trait bound `F: FloatCore` is not satisfied
    --> world/src/sim/erosion.rs:2058:29
     |
2058 |                 NotNan::new(pass).unwrap(),
     |                 ----------- ^^^^ the trait `FloatCore` is not
implemented for `F`
     |                 |
     |                 required by a bound introduced by this call
     |
note: required by a bound in `NotNan::<T>::new`
    --> cargo-crates/ordered-float-3.7.0/src/lib.rs:943:9
     |
943  | impl<T: Float> NotNan<T> {
     |         ^^^^^ required by this bound in `NotNan::<T>::new`
help: consider further restricting this bound
     |
1822 | pub fn get_lakes<F: Float + vek::num_traits::float::FloatCore>(
     |                           +++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `F: FloatCore` is not satisfied
    --> world/src/sim/erosion.rs:2057:24
     |
2057 |             candidates.push(Reverse((
     |                        ^^^^ the trait `FloatCore` is not implemented for
`F`
     |
     = note: required for `NotNan<F>` to implement `Ord`
     = note: 2 redundant requirements hidden
     = note: required for `std::cmp::Reverse<(NotNan<F>, (u32, u32))>` to
implement `Ord`
note: required by a bound in `BinaryHeap::<T>::push`
    --> rustc-1.69.0-src/library/alloc/src/collections/binary_heap/mod.rs:541:5
help: consider further restricting this bound
     |
1822 | pub fn get_lakes<F: Float + vek::num_traits::float::FloatCore>(
     |                           +++++++++++++++++++++++++++++++++++

error[E0277]: the trait bound `F: FloatCore` is not satisfied
    --> world/src/sim/erosion.rs:2019:26
     |
2019 |     let mut candidates = BinaryHeap::with_capacity(indirection.len());
     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FloatCore`
is not implemented for `F`
     |
     = note: required for `NotNan<F>` to implement `Ord`
     = note: 2 redundant requirements hidden
     = note: required for `std::cmp::Reverse<(NotNan<F>, (u32, u32))>` to
implement `Ord`
note: required by a bound in `BinaryHeap::<T>::with_capacity`
    --> rustc-1.69.0-src/library/alloc/src/collections/binary_heap/mod.rs:438:5
help: consider further restricting this bound
     |
1822 | pub fn get_lakes<F: Float + vek::num_traits::float::FloatCore>(
     |                           +++++++++++++++++++++++++++++++++++

error[E0599]: the method `pop` exists for struct
`BinaryHeap<Reverse<(NotNan<F>, (u32, u32))>>`, but its trait bounds were not
satisfied
    --> world/src/sim/erosion.rs:2073:74
     |
2073 |     while let Some(Reverse((_, (chunk_idx, neighbor_idx)))) =
candidates.pop() {
     |                                                                         
^^^ method cannot be called on `BinaryHeap<Reverse<(NotNan<F>, (u32, u32))>>`
due to unsatisfied trait bounds
    --> rustc-1.69.0-src/library/core/src/cmp.rs:603:1
     |
     = note: doesn't satisfy `_: Eq`
     |
     = note: doesn't satisfy `std::cmp::Reverse<(NotNan<F>, (u32, u32))>: Ord`
     |
     = note: the following trait bounds were not satisfied:
             `std::cmp::Reverse<(NotNan<F>, (u32, u32))>: Ord`
             `std::cmp::Reverse<(NotNan<F>, (u32, u32))>: std::cmp::Eq`
             which is required by `std::cmp::Reverse<(NotNan<F>, (u32, u32))>:
Ord`

error[E0599]: the method `push` exists for struct
`BinaryHeap<Reverse<(NotNan<F>, (u32, u32))>>`, but its trait bounds were not
satisfied
    --> world/src/sim/erosion.rs:2129:24
     |
2129 |             candidates.push(Reverse((
     |             -----------^^^^ method cannot be called on
`BinaryHeap<Reverse<(NotNan<F>, (u32, u32))>>` due to unsatisfied trait bounds
    --> rustc-1.69.0-src/library/core/src/cmp.rs:603:1
     |
     = note: doesn't satisfy `_: Eq`
     |
     = note: doesn't satisfy `std::cmp::Reverse<(NotNan<F>, (u32, u32))>: Ord`
     |
     = note: the following trait bounds were not satisfied:
             `std::cmp::Reverse<(NotNan<F>, (u32, u32))>: Ord`
             `std::cmp::Reverse<(NotNan<F>, (u32, u32))>: std::cmp::Eq`
             which is required by `std::cmp::Reverse<(NotNan<F>, (u32, u32))>:
Ord`

error[E0277]: the trait bound `F: FloatCore` is not satisfied
    --> world/src/sim/erosion.rs:2130:29
     |
2130 |                 NotNan::new(pass).unwrap(),
     |                 ----------- ^^^^ the trait `FloatCore` is not
implemented for `F`
     |                 |
     |                 required by a bound introduced by this call
     |
note: required by a bound in `NotNan::<T>::new`
    --> cargo-crates/ordered-float-3.7.0/src/lib.rs:943:9
     |
943  | impl<T: Float> NotNan<T> {
     |         ^^^^^ required by this bound in `NotNan::<T>::new`
help: consider further restricting this bound
     |
1822 | pub fn get_lakes<F: Float + vek::num_traits::float::FloatCore>(
     |                           +++++++++++++++++++++++++++++++++++

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `veloren-world` due to 6 previous errors

See also https://gitlab.com/veloren/veloren/-/commit/3a19669d5362

-- 
You are receiving this mail because:
You are on the CC list for the bug.