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

zoxide fails to build using cargo #249

Closed
Matty666 opened this issue Aug 15, 2021 · 13 comments · Fixed by #250
Closed

zoxide fails to build using cargo #249

Matty666 opened this issue Aug 15, 2021 · 13 comments · Fixed by #250

Comments

@Matty666
Copy link

Seems like clap version v3.0.0-beta.4 has changed AppSettings

   Compiling clap v3.0.0-beta.4
     Running `rustc --crate-name clap --edition=2018 C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\clap-3.0.0-beta.4\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off --cfg "feature=\"atty\"" --cfg "feature=\"cargo\"" --cfg "feature=\"clap_derive\"" --cfg "feature=\"color\"" --cfg "feature=\"default\"" --cfg "feature=\"derive\"" --cfg "feature=\"env\"" --cfg "feature=\"lazy_static\"" --cfg "feature=\"std\"" --cfg "feature=\"strsim\"" --cfg "feature=\"suggestions\"" --cfg "feature=\"termcolor\"" --cfg "feature=\"unicode_help\"" -C metadata=0bce4592aa7031ae -C extra-filename=-0bce4592aa7031ae --out-dir C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps -L dependency=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps --extern atty=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libatty-82f1b0838f239dfe.rmeta --extern bitflags=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libbitflags-97decd3e5ff078d7.rmeta --extern clap_derive=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\clap_derive-976768dc8f0255fe.dll --extern indexmap=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libindexmap-75a06404c85919f3.rmeta --extern lazy_static=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\liblazy_static-0a5b829d44796e9f.rmeta --extern os_str_bytes=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libos_str_bytes-6345461e4736957c.rmeta --extern strsim=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libstrsim-eab915007f0ee24b.rmeta --extern termcolor=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libtermcolor-3502bb32a0c02316.rmeta --extern textwrap=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libtextwrap-e519391d94a15a07.rmeta --extern vec_map=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libvec_map-5808d1c46f198e2b.rmeta --cap-lints allow`
     Running `rustc --crate-name clap --edition=2018 C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\clap-3.0.0-beta.4\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C codegen-units=1 --cfg "feature=\"atty\"" --cfg "feature=\"cargo\"" --cfg "feature=\"clap_derive\"" --cfg "feature=\"color\"" --cfg "feature=\"default\"" --cfg "feature=\"derive\"" --cfg "feature=\"env\"" --cfg "feature=\"lazy_static\"" --cfg "feature=\"std\"" --cfg "feature=\"strsim\"" --cfg "feature=\"suggestions\"" --cfg "feature=\"termcolor\"" --cfg "feature=\"unicode_help\"" -C metadata=3fbac080c01fbc87 -C extra-filename=-3fbac080c01fbc87 --out-dir C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps -L dependency=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps --extern atty=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libatty-c9171e92b4d1dd65.rmeta --extern bitflags=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libbitflags-229af4eb2a23e45e.rmeta --extern clap_derive=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\clap_derive-976768dc8f0255fe.dll --extern indexmap=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libindexmap-aa2a47a06db5bd89.rmeta --extern lazy_static=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\liblazy_static-8afa2efcdcccd1ee.rmeta --extern os_str_bytes=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libos_str_bytes-45feee6afb0c8ac6.rmeta --extern strsim=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libstrsim-b7e7ffcf43f437af.rmeta --extern termcolor=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libtermcolor-7dfd03214c6099ec.rmeta --extern textwrap=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libtextwrap-5f4e98ab818a0285.rmeta --extern vec_map=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libvec_map-f8373962f89a3c43.rmeta --cap-lints allow`

and results in

   Compiling zoxide v0.7.2
     Running `rustc --crate-name build_script_build --edition=2018 C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\zoxide-0.7.2\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg "feature=\"default\"" -C metadata=b1b949cc5e60e9e1 -C extra-filename=-b1b949cc5e60e9e1 --out-dir C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\build\zoxide-b1b949cc5e60e9e1 -L dependency=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps --extern clap=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libclap-0bce4592aa7031ae.rlib --extern clap_generate=C:\Users\matt\AppData\Local\Temp\cargo-installA87g5B\release\deps\libclap_generate-6eb312e9dfec6ccf.rlib --cap-lints allow`
error[E0599]: no variant or associated item named `GlobalVersion` found for enum `AppSettings` in the current scope
  --> C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\zoxide-0.7.2\src\app\_app.rs:21:33
   |
21 |     global_setting(AppSettings::GlobalVersion),
   |                                 ^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`

error[E0599]: no variant or associated item named `VersionlessSubcommands` found for enum `AppSettings` in the current scope
  --> C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\zoxide-0.7.2\src\app\_app.rs:22:33
   |
22 |     global_setting(AppSettings::VersionlessSubcommands),
   |                                 ^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`

error: aborting due to 2 previous errors

Looks like the two enums are there in the older betas

@Matty666 Matty666 changed the title zoxide is fails to build using cargo zoxide fails to build using cargo Aug 15, 2021
@mfrw
Copy link

mfrw commented Aug 15, 2021

What i am wondering is: Cargo.toml explicitly mentions a dependency on clap/clap_generate = v3.0.0-beta.2, which builds fine.
Not sure, why cargo install zoxide resolves: clap/clap_generate = v3.0.0-beta.4.
Apologies, if it is a naive question.

@Matty666
Copy link
Author

According to the doco, specifying clap = "3.0.0-beta.2" in the dependencies is the same as specifying clap = "^3.0.0-beta.2" for the semver operation, which is, i think, > 3.0.0-beta.2 and <4.0.0

@ajeetdsouza
Copy link
Owner

That's correct -- I've changed it to use the format clap = "=3.0.0-beta.4" to pin the version. I'll remove it once clap comes out of beta.

@Matty666
Copy link
Author

@ajeetdsouza it's clap v3.0.0-beta.4 that is causing the problem, it seems to have removed the values from the AppSettings enum:

   Compiling clap_derive v3.0.0-beta.4
   Compiling clap v3.0.0-beta.4
   Compiling askama_derive v0.10.5
   Compiling askama v0.10.5
   Compiling clap_generate v3.0.0-beta.4
   Compiling zoxide v0.7.3
error[E0599]: no variant or associated item named `GlobalVersion` found for enum `AppSettings` in the current scope
  --> C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\zoxide-0.7.3\src\app\_app.rs:21:33
   |
21 |     global_setting(AppSettings::GlobalVersion),
   |                                 ^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`

error[E0599]: no variant or associated item named `VersionlessSubcommands` found for enum `AppSettings` in the current scope
  --> C:\Users\matt\.cargo\registry\src\github.com-1ecc6299db9ec823\zoxide-0.7.3\src\app\_app.rs:22:33
   |
22 |     global_setting(AppSettings::VersionlessSubcommands),
   |                                 ^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `zoxide`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `zoxide v0.7.3`, intermediate artifacts can be found at `C:\Users\matt\AppData\Local\Temp\cargo-install9cHYnY`

Caused by:
  build failed

@Matty666
Copy link
Author

According to this page v3.0.0-beta.2 has the values that are used, but beta3 and beta4 don't

@ajeetdsouza
Copy link
Owner

@Matty666 try installing it again, it should be fixed now.

@Matty666
Copy link
Author

@ajeetdsouza awesome! yeah 0.7.4 worked fine! thanks for the quick fix!

@AckslD
Copy link

AckslD commented Aug 16, 2021

Upgrading the AUR package still fails for me even though it's saying it's trying to install 0.7.4-1.

@ajeetdsouza
Copy link
Owner

@AckslD zoxide just got added to the official Arch community repository, you might want to uninstall your current version and run pacman -Sy zoxide.

@AckslD
Copy link

AckslD commented Aug 17, 2021

Thanks @ajeetdsouza! That worked for me :)

@horseinthesky
Copy link

Hey.
It seems like it should be fine now but I have the same issue with clap now when trying to install via cargo install zoxide:

   Compiling dirs-next v2.0.0
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.4
   Compiling ordered-float v2.8.0
   Compiling tempfile v3.2.0
   Compiling askama_shared v0.11.1
   Compiling clap_derive v3.0.0-beta.4
   Compiling askama_derive v0.10.5
   Compiling clap v3.0.0-beta.4
error[E0658]: arbitrary expressions in key-value attributes are unstable
 --> /home/horseinthesky/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10
  |
8 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information

error[E0658]: arbitrary expressions in key-value attributes are unstable
 --> /home/horseinthesky/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10
  |
8 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information

   Compiling askama v0.10.5
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: could not compile `clap`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: failed to compile `zoxide v0.7.7`, intermediate artifacts can be found at `/tmp/cargo-installrYQcK7`

Caused by:
  build failed

Am I doing something wrong?

@horseinthesky
Copy link

Sorry for bothering you. Fixed with updating cargo with

rustup update stable

as you said here

@ajeetdsouza
Copy link
Owner

Not a problem!

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

Successfully merging a pull request may close this issue.

5 participants