build: scope warnings-as-error to project targets, not FetchContent subprojects#819
Open
yadavay-amzn wants to merge 1 commit into
Open
build: scope warnings-as-error to project targets, not FetchContent subprojects#819yadavay-amzn wants to merge 1 commit into
yadavay-amzn wants to merge 1 commit into
Conversation
Collaborator
|
Could you please configure pre-commit locally? It seems the patch contains some unnecessary changes. |
1131c39 to
e8a1856
Compare
Author
|
Done - configured pre-commit locally with the pinned cmake-format (v0.6.10), reverted the unrelated cosmetic reformattings, and re-pushed. The diff now contains only the warnings-as-error scoping change and passes pre-commit. |
zhjwpku
approved these changes
Jul 6, 2026
evindj
reviewed
Jul 6, 2026
evindj
left a comment
Contributor
There was a problem hiding this comment.
The change looks good to me. However, I wonder if this comes from an hypothetical or an actual occurence where the dependencies triggering the issue was not able/willing to address. I generally agree that we should do this but I wonder if relaxing the requirement causes side effects.
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.
What
Fixes #246.
-Werror(via a globalCMAKE_COMPILE_WARNING_AS_ERROR) leaked into FetchContent-built dependencies, so a warning in a third-party subproject (e.g. Arrow) could fail the whole build. As noted on the issue, the global flag does not reliably isolate subprojects.How
CMAKE_COMPILE_WARNING_AS_ERROR ON.COMPILE_WARNING_AS_ERROR ONas a per-target property on Iceberg's own shared/static libraries, so the project stays strict.BUILD_WARNING_LEVEL PRODUCTIONfor Arrow to suppress its independent-Werrorinjection.prepare_fetchcontent()for the case where-DCMAKE_COMPILE_WARNING_AS_ERROR=ONis passed on the command line.Verified
Iceberg targets still compile with
-Werror; FetchContent subprojects do not. Build + tests green (18/18).This contribution was authored with assistance from Claude Opus 4.8, in line with the Iceberg guidelines for AI-assisted contributions (https://iceberg.apache.org/contribute/#guidelines-for-ai-assisted-contributions). All changes were reviewed and tested by the author.