Overview
I am having an issue building rust documentation with GitHub Actions for a particular repo. The repo is open-source and you can view it here and the erroring GitHub Action here. The linked repo is a fork but it also fails with the same error on the upstream repo. You can also view the current GitHub Action workflow file here.
Running cargo doc --release --no-deps --open locally works perfectly fine, but in the CI environment it fails with the below message.
Things I've tried
Excluding the problematic packages using --exclude, but in doing so, the next package complains (e.g. first it was webb-client, then webb-primitives)
Fetching the submodules before running cargo doc
Running cargo build --release before running cargo doc
Running with all-features flag
Some relevant issues I found
https://github.com/rust-lang/rust/issues/93698
Error from CI
thread 'rustc' panicked at 'no entry found for key', src/librustdoc/passes/collect_intra_doc_links.rs:930:16
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
error: Unrecognized option: 'crate-version'
error: could not document `webb-primitives`
Related
I am trying to build a standalone application through which I can run Rust Clippy without needing to install it locally. Essentially, I want to run a command like cargo-clippy -- --message-format=json through my application when a Rust project is uploaded to it.
What I've tried:
I installed cargo locally using the instructions here
I forked the Clippy repo locally into a folder called clippy_local
I ran cargo build on the repo which created some exe binary files including cargo-clippy under clippy_local/target/debug/ (contents of the target folder attached in screenshot below)
I copied this cargo-clippy exe into the tool binaries folder for my application
After this, the project compiles, but when I try to run Clippy through my tool, I get an error like below:
dyld[14510]: Library not loaded: '#rpath/librustc_driver-6ca1b5240144bf0b.dylib'
Referenced from: '/Users/<redacted>/repos/<redacted>/target/webapp/WEB-INF/classes/tools/clippy/cargo-clippy'
Reason: tried: '/usr/local/lib/librustc_driver-6ca1b5240144bf0b.dylib' (no such file), '/usr/lib/librustc_driver-6ca1b5240144bf0b.dylib' (no such file)
My app is running the following command internally to invoke Clippy:
/Users/<redacted>/repos/<redacted>/target/webapp/WEB-INF/classes/tools/clippy/cargo-clippy -- --message-format=json
I was guessing from the error that it has something to do with missing libraries/dependencies (apart from the cargo-clippy exe). I have tried to copy all the contents of the target/debug folder into my app as well, but the same error still persists.
So, I want to know what's going wrong and how I can build a Rust Clippy binary which I can then use to run Clippy from other applications?
For some reason Rust Analyzer isn't generating a warning for undefined variables. Do I need to tweak some settings somewhere?
I'm also not getting warnings for unused variables, unimported crates, etc.
Edit: Tested this out with a new workspace. Both cargo check and Rust Analyzer work. It reports a single intentional error. When I run cargo check in the first workspace, it reports a lot of errors in the ~/.cargo directory, and none in the current workspace. Perhaps a crate I am using has errors and is locking up cargo check before it can get around to checking the files in my directory?
The log when running cargo check showed some issues with ~/.cargo/registry/src/github.com-xx..xx/rppal-0.12.0. This came from a the crate rust_gpiozero that I had listed as a dependency. As best as I can figure, cargo check was failing on this and then ceasing to analyze my files. After removing this dependency, both cargo check and Rust Analyzer run as expected.
Cheers to all who replied to this thread for their guidance.
Rust-analyzer itself doesn't produce errors or warnings for this.
If you want warnings and errors, enable the "Check on Enable" option in the rust-analyzer extension. This will run cargo check every time you save a Rust file and display the emitted warnings and errors in the files.
For another possible cause: try cargo clean.
This problem happened to me after upgrading my toolchain version. As mentioned in other answers, running cargo check yielded many errors. The topmost error mentioned a crate "compiled by an incompatible version of rustc." Running cargo clean followed by cargo check fixed all errors.
I installed a GitLab runner in a Build server and registered a runner for a Project I have in GitLab.
The Build Stage has the following in the first line:
'D:\scripts\NuGet\NuGet.exe restore %CI_PROJECT_DIR%%SOLUTION_FILE%'
I already verified %SOLUTION_FILE%' has the right value however I get the following error:
Cannot locate a solution file.
I already checked everything I could think of but I can't figure out why it can't find the solution file.
I'm attempting to compile a kivy app for android using the python3crystax recipe. When building only with recipes listed in python-for-android, it compiles fine, but whenever I attempt to add a pip dependency, it fails with this error:
[ERROR]: Didn't find any valid dependency graphs.
[ERROR]: This means that some of your requirements pull in conflicting dependencies.
[ERROR]: Exiting.
When using the python2 recipe, however, it compiles fine. Does python3crystax support installing dependencies over pip?
It sounds like your dependency does have a recipe, but that the recipe isn't marked as python3crystax compatible. Give more information about what you're attempting if you want a more specific answer.
I was able to workaround this issue by changing the python-for-android branch that buildozer uses from stable to master in my buildozer.spec file. This gave me access to the new python3 recipe and that seems to be working fine.
I'm trying to build a Rust project (xray). When running cargo run I get the following error message
error: manifest path D:\xray\building\xray\Cargo.toml is a virtual
manifest, but this command requires running against an actual package
in this workspace
What exactly does this mean and how can it be solved? I'm using Cargo version 0.25.0 and Rust version 1.24.1.
Your Cargo.toml is a virtual manifest.
In workspace manifests, if the package table is present, the workspace root crate will be treated as a normal package, as well as a workspace. If the package table is not present in a workspace manifest, it is called a virtual manifest.
When working with virtual manifests, package-related cargo commands, like cargo build, won't be available anymore. But, most of such commands support the --all option, will execute the command for all the non-virtual manifest in the workspace.
cargo run does not work, because cargo doesn't know what to run. There are two options:
--manifest-path <PATH>: Path to Cargo.toml of the crate you want to run.
-p, --package <SPEC>: Package you want to run.
In your case it's probably cargo run --package xray_cli
the manifest has both package and workspace sections can't works. please check the Cargo.toml and remove package from it.
Virtual Manifest is new concepts, please reading docs to familiar it. Hope it values for you.