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

Fix CI build to unblock dependabots #659

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

ytsssun
Copy link
Contributor

@ytsssun ytsssun commented Aug 7, 2024

Issue number:
Fix the CI to unblock PRs:
#658
#657
#656
#654

Description of changes:
I am seeing build failures when running make build with the latest rustc version (rustup update stable to update).

Failure 1: Starting with Rust 1.80 (or nightly-2024-05-05) every reachable #[cfg] will be automatically checked that they match the expected config names and values. See more details in this blog.

Our CI build failed with

error: unexpected `cfg` condition name: `mockall`
 --> apiserver/src/auth/mod.rs:9:11
  |
9 | #[cfg(any(mockall, test))]
  |           ^^^^^^^ help: found config with similar value: `feature = "mockall"`

One way to fix it is to add the lints table in Cargo.toml.

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mockall)'] }

But we are using feature = "mockall" everywhere else, so making the change for consistency.

Failure 2: Also with the Rust 1.80 release, there is another linter error clippy::needless_borrows_for_generic_args (See more details here).

error: the borrowed expression implements the required traits
   --> integ/src/nodegroup_provider.rs:366:20
    |
366 |         .role_name(&iam_instance_profile_name.clone())
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `iam_instance_profile_name.clone()`

Testing done:
make build passed.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

- Another way to fix this is to specify mockall in the lints explicitly as
unexpected cfg and treat it as warn instead of error. But we are using #[cfg(any(feature = "mockall", test))]
in the rest of our code, so making this change for consistency.

Signed-off-by: Yutong Sun <[email protected]>
@ytsssun ytsssun merged commit 73d26a8 into bottlerocket-os:develop Aug 7, 2024
2 checks passed
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