Repository navigation
Pass -Werror when building LLVM wrapper in CI #109712
Copy link
Copy link
Open
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
While building rustc against an installed llvm-16.0.0, the following warnings occur, twice:
warning: llvm-wrapper/PassWrapper.cpp:538:7: warning: 'any_isa<const llvm::Module *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning: if (any_isa<const Module *>(WrappedIr))
warning: ^~~~~~~
warning: any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Module *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning: ^
warning: llvm-wrapper/PassWrapper.cpp:540:7: warning: 'any_isa<const llvm::Function *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning: if (any_isa<const Function *>(WrappedIr))
warning: ^~~~~~~
warning: any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Function *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning: ^
warning: llvm-wrapper/PassWrapper.cpp:542:7: warning: 'any_isa<const llvm::Loop *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning: if (any_isa<const Loop *>(WrappedIr))
warning: ^~~~~~~
warning: any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::Loop *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning: ^
warning: llvm-wrapper/PassWrapper.cpp:544:7: warning: 'any_isa<const llvm::LazyCallGraph::SCC *>' is deprecated: Use any_cast(Any*) != nullptr instead [-Wdeprecated-declarations]
warning: if (any_isa<const LazyCallGraph::SCC *>(WrappedIr))
warning: ^~~~~~~
warning: any_cast
warning: /usr/local/include/llvm/ADT/Any.h:130:1: note: 'any_isa<const llvm::LazyCallGraph::SCC *>' has been explicitly marked deprecated here
warning: LLVM_DEPRECATED("Use any_cast(Any*) != nullptr instead", "any_cast")
warning: ^
warning: /usr/local/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
warning: #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
warning: ^
warning: 4 warnings generated.
rustc --version --verbose:
rustc 1.68.1 (8460ca823 2023-03-20) (built from a source tarball)
binary: rustc
commit-hash: 8460ca823e8367a30dda430efda790588b8c84d3
commit-date: 2023-03-20
host: x86_64-apple-darwin
release: 1.68.1
LLVM version: 16.0.0
This report is to document the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Activity
jyn514 commentedon Apr 3, 2023
Oh, I saw these recently too actually. They also exist on latest master.
jyn514 commentedon Apr 3, 2023
Probably we should block CI on these errors? They should at least be controlled by
deny-warningsin config.toml.klensy commentedon May 7, 2023
Fixed by #110523?
jyn514 commentedon May 7, 2023
The warning was fixed, but we should still block on warnings in CI.
[-]LLVM deprecation warnings while building rustc 1.68.2 against llvm-16.0.0[/-][+]Pass -Werror when building LLVM in CI[/+]rperier commentedon Jul 11, 2025
@rustbot claim
[-]Pass -Werror when building LLVM in CI[/-][+]Pass -Werror when building LLVM wrapper in CI[/+]Rollup merge of rust-lang#143807 - rperier:rustc_llvm_werror, r=cuviper
Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
2 remaining items
Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
rperier commentedon Sep 5, 2025
Even if it is fixed by PR #143807, I propose the keep this issue opened until it is fixed without workaround for msvc. It should be fixable with llvm22, there is a FIXME (see #143807 (comment))
nikic commentedon Sep 5, 2025
I don't think this should ever be enabled with MSVC. LLVM generally only guarantees warning-freedom when building with Clang, as other compilers have too many false positives. And MSVC is the absolute king of useless, false-positive compiler warnings.
rperier commentedon Sep 5, 2025
If we really have too many false positives, we can keep it disabled, I agree. We have to remove the FIXME, in this case. @tgross35 what do you think ? (keep it disabled forever and do not wait llvm22).
tgross35 commentedon Sep 5, 2025
No objection, I didn't consider that context. Changing a FIXME to a comment to that effect seems reasonable.
Rollup merge of rust-lang#146272 - rperier:rustc_llvm_werror_remove_c…
Unrolled build for #146272
Auto merge of rust-lang#143807 - rperier:rustc_llvm_werror, r=cuviper
Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
Rollup merge of #146272 - rperier:rustc_llvm_werror_remove_commment_l…
Auto merge of rust-lang#143807 - rperier:rustc_llvm_werror, r=cuviper
Auto merge of rust-lang#143807 - rperier:rustc_llvm_werror, r=cuviper