Fix two different crashes in the new clippy integration#747
Open
Synss wants to merge 2 commits intoaspect-build:mainfrom
Open
Fix two different crashes in the new clippy integration#747Synss wants to merge 2 commits intoaspect-build:mainfrom
Synss wants to merge 2 commits intoaspect-build:mainfrom
Conversation
|
This fixes the following error
```% bazel lint --fixes=true //packages/check-cert/...
INFO: Invocation ID: 7be4597f-1cdb-4599-8cd8-c795b94fb9ba
ERROR: file 'packages/check-cert/src/main.rs' is generated by these conflicting actions:
Label: //packages/check-cert:check-cert
Aspects: [//bazel/tools:aspects.bzl%clippy], []
RuleClass: rust_binary rule
JavaActionClass: class com.google.devtools.build.lib.analysis.actions.StarlarkAction, class com.google.devtools.build.lib.analysis.actions.SymlinkAction
Configuration: 11c983bfde6556f27385ff463d234d63620916bbadff4748d5a3134668d2d2a3
Mnemonic: CopyFile, Symlink
Action key: 89b77dc2f00dcd76ab89e69c729a73c02f3f6f42216718dadf546eb08b264d71, 7a39b61d5744a8903119e17b3ddc7e56e330f240d2bead98c3ba081a81b5c9ac
Progress message: Copying file packages/check-cert/src/main.rs, Creating symlink to source file:
packages/check-cert/src/main.rs
Action describeKey: Copying file packages/check-cert/src/main.rs
Execution info: no-sandbox=1
Argument: external/aspect_bazel_lib++toolchains+coreutils_linux_amd64/coreutils
Argument: cp
Argument: packages/check-cert/src/main.rs
Argument: bazel-out/k8-fastbuild/bin/packages/check-cert/src/main.rs
Output paths mode: OFF
, GUID: 7f4fab4d-d0a7-4f0f-8649-1d0337a21fee
inputPath: null
PrimaryInput: File:[/home/mathiaslaurin/src/checkmk/master.git[source]]packages/check-cert/src/main.rs
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-fastbuild/bin]packages/check-cert/src/main.rs
Owner information: //packages/check-cert:check-cert#//bazel/tools:aspects.bzl%clippy
ConfiguredTargetKey{label=//packages/check-cert:check-cert, config=BuildConfigurationKey[11c983bfde6556f27385ff463d234d63620916bbadff4748d5a3134668d2d2a3]} {},
ConfiguredTargetKey{label=//packages/check-cert:check-cert, config=BuildConfigurationKey[11c983bfde6556f27385ff463d234d63620916bbadff4748d5a3134668d2d2a3]}
MandatoryInputs: Attempted action contains artifacts not in previous action (first 5):
coreutils
Outputs: are equal
Use --verbose_failures to see the command lines of failed build steps.
ERROR: file 'packages/check-cert/src/main.rs' is generated by these conflicting actions:
Label: //packages/check-cert:check-cert
Aspects: [//bazel/tools:aspects.bzl%clippy], []
RuleClass: rust_binary rule
JavaActionClass: class com.google.devtools.build.lib.analysis.actions.StarlarkAction, class
com.google.devtools.build.lib.anal
ysis.actions.SymlinkAction
Configuration: 11c983bfde6556f27385ff463d234d63620916bbadff4748d5a3134668d2d2a3
Mnemonic: CopyFile, Symlink
Action key: 89b77dc2f00dcd76ab89e69c729a73c02f3f6f42216718dadf546eb08b264d71, 7a39b61d5744a8903119e17b3ddc7e56e330f240d2bead98c3ba081a81b5c9ac
Progress message: Copying file packages/check-cert/src/main.rs, Creating symlink to source file:
packages/check-cert/src/main.rs
Action describeKey: Copying file packages/check-cert/src/main.rs
Execution info: no-sandbox=1
Argument: external/aspect_bazel_lib++toolchains+coreutils_linux_amd64/coreutils
Argument: cp
Argument: packages/check-cert/src/main.rs
Argument: bazel-out/k8-fastbuild/bin/packages/check-cert/src/main.rs
Output paths mode: OFF
, GUID: 7f4fab4d-d0a7-4f0f-8649-1d0337a21fee
inputPath: null
PrimaryInput: File:[/home/mathiaslaurin/src/checkmk/master.git[source]]packages/check-cert/src/main.rs
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-fastbuild/bin]packages/check-cert/src/main.rs
Owner information: //packages/check-cert:check-cert#//bazel/tools:aspects.bzl%clippy
ConfiguredTargetKey{label=//packages/chec
k-cert:check-cert, config=BuildConfigurationKey[11c983bfde6556f27385ff463d234d63620916bbadff4748d5a3134668d2d2a3]} {},
ConfiguredTargetKey{label=//packages/check-cert:check-cert, config=BuildConfigurationKey[11c983bfde6556f27385ff463d234d63620916bbadff4748d5a3134668d2d2a3]}
MandatoryInputs: Attempted action contains artifacts not in previous action (first 5):
coreutils
Outputs: are equal
INFO: Elapsed time: 0.445s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
INFO: Build Event Protocol files produced successfully.
FAILED:
```
939cb8e to
062343d
Compare
Fixes crash ``` The following files have no generating action: packages/check-cert/check-cert-lib.AspectRulesLintClippy.out.exit_code packages/check-cert/check-cert-lib.AspectRulesLintClippy.report.exit_code ``` Also fixes handling of exit_code, because we pass `-Wwarnings` to clippy, the linter does not treat warnings as errors, as a result, `clippy` may return with an exit code of 0 on findings. In such cases, `fail_on_violation` is ignored. We can fix this by explicitly searching whether clippy reports any warning and use this value as well to determine which exit code to emit.
Contributor
Author
|
The CI failure comes from linting rust code that actually contains linting errors. That's the expected behavior, isn't it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This fixes two bugs producing crashes in the recent clippy (rust) integration,
Even with these patches,
fail_on_violationdoesn't work reliably in our repo.Changes are visible to end-users: no
Test plan