Skip to content

Compile issues on nightly #369

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

Closed
BaxterEaves opened this issue Aug 18, 2018 · 11 comments
Closed

Compile issues on nightly #369

BaxterEaves opened this issue Aug 18, 2018 · 11 comments

Comments

@BaxterEaves
Copy link

BaxterEaves commented Aug 18, 2018

Updated nightly this morning and rebuilt a package that has nalgebra as a dependency and I got a lot of not found type compile errors:

 Compiling nalgebra v0.16.0
error[E0432]: unresolved import `geometry::Isometry`
  --> /Users/baxtereaves/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/nalgebra-0.16.0/src/base/cg.rs:15:16
   |
15 | use geometry::{Isometry, IsometryMatrix3, Orthographic3, Perspective3, Point, Point3, Rotation2,
   |                ^^^^^^^^ no `Isometry` in `geometry`. Did you mean to use `isometry`?

error[E0432]: unresolved import `geometry::Isometry`
  --> /Users/baxtereaves/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/nalgebra-0.16.0/src/geometry/rotation_conversion.rs:13:16
   |
13 | use geometry::{Isometry, Point, Rotation, Rotation2, Rotation3, Similarity, SuperTCategoryOf,
   |                ^^^^^^^^ no `Isometry` in `geometry`. Did you mean to use `isometry`?

error[E0432]: unresolved import `geometry::Similarity`
  --> /Users/baxtereaves/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/nalgebra-0.16.0/src/geometry/rotation_conversion.rs:13:65
   |
13 | use geometry::{Isometry, Point, Rotation, Rotation2, Rotation3, Similarity, SuperTCategoryOf,
   |                                                                 ^^^^^^^^^^ no `Similarity` in `geometry`. Did you mean to use `similarity`?

error[E0432]: unresolved import `geometry::Isometry`
  --> /Users/baxtereaves/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/nalgebra-0.16.0/src/geometry/quaternion_conversion.rs:11:16
   |
11 | use geometry::{Isometry, Point3, Quaternion, Rotation, Rotation3, Similarity, SuperTCategoryOf,
   |                ^^^^^^^^ no `Isometry` in `geometry`. Did you mean to use `isometry`?

error[E0432]: unresolved import `geometry::Similarity`
  --> /Users/baxtereaves/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/nalgebra-0.16.0/src/geometry/quaternion_conversion.rs:11:67
   |
11 | use geometry::{Isometry, Point3, Quaternion, Rotation, Rotation3, Similarity, SuperTCategoryOf,
   |                                                                   ^^^^^^^^^^ no `Similarity` in `geometry`. Did you mean to use `similarity`?

error[E0432]: unresolved import `geometry::Isometry`
 --> /Users/baxtereaves/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/nalgebra-0.16.0/src/geometry/unit_complex_ops.rs:9:16
  |
9 | use geometry::{Isometry, Point2, Rotation, Similarity, Translation, UnitComplex};
  |                ^^^^^^^^ no `Isometry` in `geometry`. Did you mean to use `isometry`?

...and so on. I've left a lot out because it was super long. I reverted back to the previous toolchain that i was using, nightly-2018-08-15-x86_64-apple-darwin, and it worked.

NOTE: I successfully compiled the code on my gitlab CI, which is using the nightly image, so it might be a problem with the apple toolchain.

EDIT: Actually, the nightly docker image hadn't been pushed yet. Now my CI is broken as well.

@Lecrapouille
Copy link

Lecrapouille commented Aug 23, 2018

I've the same problem (unresolved import geometry::Isometry) on Debian (amd64). I'm a total newbie with Rust. I installed it with: curl -s https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly and my rustc version is rustc 1.30.0-nightly (33b923fd4 2018-08-18)

@sebcrozet
Copy link
Member

This issue looks like a regression on the nightly compiler. However, it does compile correctly on my machine (MacOS) with the latest nightly: rustc 1.30.0-nightly (33b923fd4 2018-08-18)

@Lecrapouille What project exactly are you compiling? Can you try cloning the nalgebra repo and compiling it alone? I have the same compiler version as you but manage to compile nalgebra just fine, so I am not sure how to reproduce the errors.

@Lecrapouille
Copy link

Lecrapouille commented Aug 24, 2018

@sebcrozet I cloned your master branch and compiled it with success :) So sorry for the confusion, what I wanted to said is I got failure with this project then I saw this issue with the same error concerning geometry::Isometry. I've just started learning Rust since yesterday so maybe I made something wrong.

@sebcrozet
Copy link
Member

I still have not found the cause of those errors.

@BaxterEaves What package depending on nalgebra did you try to compile?

@Lecrapouille I can reproduce the compile errors by compiling citybounds. That looks like a regression on the rust compiler but I failed to identify it source. Here is the dependency graph of citybound generated by cargo graph:

deps

I tried to compile individually the game_common crate but it fails with the same errors. However, compiling any of its dependency that depend themselves on nalgebra (namely descartes and michelangelo) do succeed.

I guess the best workaround for now is to just revert the compiler version like @BaxterEaves did…

@Lecrapouille
Copy link

@sebcrozet just to let you know that I followed their .travis.yml file and the compilation passed :)

@BaxterEaves
Copy link
Author

@sebcrozet Here is the dependency graph for my rv crate that is experiencing the issues.
rainbow-graph

@Lecrapouille
Copy link

@BaxterEaves in my previous post I did not thank you for your fast answer: so thank you !

This is just a noob remark, but if these dependencies are similar to C/C++ with their #includes, having your dependencies looking a graph is not a good thing to have because depending on how to traverse the graph, the order of inclusion can be different and therefore getting problem like defining struct after another (instead of before as you were expected first). Cannot you reduce your graph to a minimum spanning tree ? (for example removing the link rv --> serve, num -->num-bigint).

@BaxterEaves
Copy link
Author

Just some extra info: I tried to clone and compile master with most recent nightly. cargo build works, but cargo build --features serde-serialize fails with the above errors.

@sebcrozet
Copy link
Member

sebcrozet commented Aug 30, 2018

@Lecrapouille Rust dependencies are not similar to C/C++ includes so having a graph does not cause any issue of redefinition. In fact the Rust compiler doesn't really care about on what order things are declared on a single crate.

@BaxterEaves Thank you for your inputs. The failure only when serde is enabled is troubling though.

@robsmith11
Copy link

My crate produced these errors as well when using nightly-2018-09-02 and the serde feature. Disabling the serde feature makes it work.

@sebcrozet
Copy link
Member

sebcrozet commented Sep 13, 2018

It appears the errors at the root of this problem are similar to:

error: cannot determine resolution for the attribute macro `serde`
 --> src/isometry.rs:7:3
  |
7 | #[serde(bound(serialize = ""))]
  |   ^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

which can be reproduced with:

use serde;

#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[serde(bound(serialize = ""))]
#[serde(bound(deserialize = ""))]
pub struct Isometry
{
}

This is likely related to rust-lang/rust#53675 which is a known but not-yet-fixed regression.

A workaround seems to avoid the use serde; by importing all the required serde struct explicitly.

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