Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
use anyhow::Result;

fn main() -> Result<()> {
if let Ok("cargo-clippy") = env::var("CARGO_CFG_FEATURE").as_ref().map(String::as_str) {
if env::var("CLIPPY_ARGS").is_ok() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity

  1. Did the previous approach ever worked?
  2. Is this documented somewhere? I'm trying to figure out if this approach is considered stable, if not, there's probably a risk of it not working in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For (1), I have no idea if it ever worked, I just know it doesn't work now. For (2), I don't think there's a stable way to detect in a build file if it's being executed with clippy.

I'm also open to deleting this check and making plugin a prerequisite for fmt-cli in the Makefile if you'd prefer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I'd prefer the latter, making plugin a prerequisite for fmt-cli, but I am not sure how that might impact our CI times. I think it should be fine, since any subsequent steps (in the same job) that need plugin shouldn't require a complete rebuild, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For CI, the plugin.wasm file should be present at the point we need to run Clippy. We might just need to do some tweaks to ensure the Makefile is intelligent enough to not do a rebuild if it is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try that approach then.

stub_plugin_for_clippy()
} else {
copy_plugin()
Expand Down