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

generate-cli-docs will be added in cargo install #1331

Open
xiaoxiangmoe opened this issue Jan 13, 2025 · 4 comments
Open

generate-cli-docs will be added in cargo install #1331

xiaoxiangmoe opened this issue Jan 13, 2025 · 4 comments

Comments

@xiaoxiangmoe
Copy link

Problem 1: build fail

cargo install rattler-build

it throws a error

error[E0277]: the trait bound `CacheKey: From<&PackageRecord>` is not satisfied
   --> /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rattler-0.27.16/src/install/installer/mod.rs:564:10
    |
564 |         .await
    |          ^^^^^ the trait `From<&PackageRecord>` is not implemented for `CacheKey`
    |
    = help: the following other types implement trait `From<T>`:
              `CacheKey` implements `From<&rattler_conda_types::repo_data::PackageRecord>`
              `CacheKey` implements `From<rattler_conda_types::package::archive_identifier::ArchiveIdentifier>`
    = note: required for `&PackageRecord` to implement `Into<CacheKey>`

problem 2, bin generate-cli-docs added but has no work

cargo install --locked --git https://github.com/prefix-dev/rattler-build.git rattler-build

Then it puts:

    Finished `release` profile [optimized] target(s) in 2m 13s
  Installing /Users/me/.cargo/bin/generate-cli-docs
  Installing /Users/me/.cargo/bin/rattler-build
   Installed package `rattler-build v0.34.1 (https://github.com/prefix-dev/rattler-build.git#d46d67df)` (executables `generate-cli-docs`, `rattler-build`)

So there exist ~/.cargo/bin/generate-cli-docs but when I run generate-cli-docs, it puts

This binary is not enabled in the current build configuration.
To enable it, run `cargo build --features generate-cli-docs`.

It should not added if bin generate-cli-docs is not working.
If we added generate-cli-docs to bin dir, it should working.

problem3 generate-cli-docs not working on compile

 cargo install --locked --git https://github.com/prefix-dev/rattler-build.git rattler-build --features generate-cli-docs

Then it puts

error[E0432]: unresolved import `clap_markdown`
 --> src/bin/generate-cli-docs.rs:6:9
  |
6 |     use clap_markdown::help_markdown;
  |         ^^^^^^^^^^^^^ use of undeclared crate or module `clap_markdown`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `rattler-build` (bin "generate-cli-docs") due to 1 previous error
@baszalmstra
Copy link
Contributor

Yeah the additional binary is a bit useless. It shouldnt be distributed.

Please use cargo install rattler-build --locked to install rattler-build with cargo.

@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Jan 13, 2025

Is generate-cli-docs just for internal use and should not added in bin?

brew install rattler-build
ls /opt/homebrew/Cellar/rattler-build/0.33.3/bin 

And it puts

generate-cli-docs  rattler-build

I found many package maneger added generate-cli-docs in their pkg bundle.

@baszalmstra
Copy link
Contributor

Yes, its just used to generate the reference documentation in the rattler-build docs. Ideally we would exclude this executable when you use cargo install, Im not sure how to do that..

@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Jan 13, 2025

Maybe add generate-cli-docs to examples directory rather than bin directory?

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

2 participants