Skip to content

Conversation

@jeffcharles
Copy link
Collaborator

Description of the change

Updates how we check for Clippy in the CLI's build.rs file.

Why am I making this change?

The existing way doesn't appear to be working. You can verify this by running cargo clean and then make fmt-cli and see it fail with a file not found error instead of using a stubbed plugin.

Checklist

  • I've updated the default plugin import namespace and incremented the major version of javy-plugin-api if the QuickJS bytecode has changed.
  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli, javy-plugin, and javy-plugin-processing do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.


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.

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 this pull request may close these issues.

3 participants