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

Cargo install fails #511

Open
nathanielc opened this issue Jul 5, 2022 · 3 comments
Open

Cargo install fails #511

nathanielc opened this issue Jul 5, 2022 · 3 comments

Comments

@nathanielc
Copy link
Contributor

I can cargo build the flux-lsp binary but I cannot cargo install the binary. It seems to be releated to enabling the lsp feature flag on the flux dependency.

See the following terminal output:

$ cargo build
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
$ cargo install --path .
  Installing flux-lsp v0.8.20 (/flux-lsp)
    Updating crates.io index
    Updating git repository `https://github.com/influxdata/flux`
   Compiling flux-lsp v0.8.20 (/flux-lsp)
error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/server/mod.rs:40:35
   |
40 |         range: node.loc().clone().into(),
   |                                   ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/server/mod.rs:294:47
    |
294 |                     range: e.location.clone().into(),
    |                                               ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/ast.rs:29:43
   |
29 |             &node.base().location.clone().into(),
   |                                           ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Position: From<flux::ast::Position>` is not satisfied
  --> src/visitors/ast.rs:57:47
   |
57 |             position: pkg.base.location.start.into(),
   |                                               ^^^^ the trait `From<flux::ast::Position>` is not implemented for `lspower::lsp_types::Position`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Position>` for `flux::ast::Position`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/lint.rs:57:57
   |
57 | ...                   range: expr.loc.clone().into(),
   |                                               ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/lint.rs:68:61
   |
68 | ...                   range: expr.loc.clone().into(),
   |                                               ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/lint.rs:131:57
    |
131 | ...                   range: expr.loc.clone().into(),
    |                                               ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/lint.rs:142:61
    |
142 | ...                   range: expr.loc.clone().into(),
    |                                               ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/lint.rs:180:50
    |
180 |                     range: assign.id.loc.clone().into(),
    |                                                  ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/symbols.rs:20:43
   |
20 |                 range: node.loc().clone().into(),
   |                                           ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/symbols.rs:33:46
   |
33 |                     range: param.loc.clone().into(),
   |                                              ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/symbols.rs:46:43
   |
46 |                 range: node.loc().clone().into(),
   |                                           ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/symbols.rs:69:38
   |
69 |                 range: c.loc.clone().into(),
   |                                      ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/symbols.rs:84:44
   |
84 |                     range: arg.loc.clone().into(),
   |                                            ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/symbols.rs:96:44
   |
96 |                     range: arg.loc.clone().into(),
   |                                            ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:120:34
    |
120 |                 range: ident.loc.into(),
    |                                  ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:134:34
    |
134 |                 range: ident.loc.into(),
    |                                  ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:202:51
    |
202 | ...                   range: me.loc.clone().into(),
    |                                             ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:216:48
    |
216 |                         range: num.loc.clone().into(),
    |                                                ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:230:48
    |
230 |                         range: num.loc.clone().into(),
    |                                                ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:244:46
    |
244 |                         range: d.loc.clone().into(),
    |                                              ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:258:46
    |
258 |                         range: b.loc.clone().into(),
    |                                              ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:272:46
    |
272 |                         range: s.loc.clone().into(),
    |                                              ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/symbols.rs:286:46
    |
286 |                         range: a.loc.clone().into(),
    |                                              ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
  --> src/visitors/semantic/mod.rs:29:48
   |
29 |     let range: lsp::Range = node.loc().clone().into();
   |                                                ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
   |
   = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
   --> src/visitors/semantic/mod.rs:227:48
    |
227 |             self.location = Some(n.loc.clone().into());
    |                                                ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
    |
    = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

error[E0277]: the trait bound `lspower::lsp_types::Range: From<flux::ast::SourceLocation>` is not satisfied
    --> src/server/mod.rs:1053:45
     |
1053 |                     &error.location.clone().into(),
     |                                             ^^^^ the trait `From<flux::ast::SourceLocation>` is not implemented for `lspower::lsp_types::Range`
     |
     = note: required because of the requirements on the impl of `Into<lspower::lsp_types::Range>` for `flux::ast::SourceLocation`

For more information about this error, try `rustc --explain E0277`.
error: failed to compile `flux-lsp v0.8.20 (/flux-lsp)`, intermediate artifacts can be found at `/flux-lsp/target`

Caused by:
  could not compile `flux-lsp` due to 27 previous errors
@rockstar
Copy link
Contributor

rockstar commented Jul 5, 2022

TIL: cargo install ignores the lock file by default. If you do cargo install --locked, that will work (I just verified). Will chase this a bit more later.

@rockstar
Copy link
Contributor

rockstar commented Jul 5, 2022

See also rust-lang/cargo#7169

@Marwes
Copy link
Contributor

Marwes commented Aug 10, 2022

Ran into this today 😠 More specifically, this is because we have a version range in flux-core which causes cargo to select 0.92 for itself while lspower is still on 0.91. So the version range doesn't seem to work as one would hope. Created influxdata/flux#5067

lsp-types = { version = ">=0.91,<=0.92", optional = true }

(cargo issue rust-lang/cargo#9029 )

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

3 participants