Skip to content

bazel: remove CMAKE_BUILD_TYPE override#17679

Closed
keith wants to merge 1 commit intoenvoyproxy:mainfrom
keith:ks/bazel-remove-cmake_build_type-override
Closed

bazel: remove CMAKE_BUILD_TYPE override#17679
keith wants to merge 1 commit intoenvoyproxy:mainfrom
keith:ks/bazel-remove-cmake_build_type-override

Conversation

@keith
Copy link
Member

@keith keith commented Aug 11, 2021

rules_foreign_cc sets this automatically to either Debug or Release
based on bazel's compilation_mode. Overriding this can cause issues when
deps' cmake configs expect to be in a specific subset of configs. Unlike
LLVM most cmake configs seem to silently fail in that case by not
setting an expected var correctly. I hit this issue when updating
rules_foreign_cc (I'm not sure of why the update broke it) and wamr
missing some settings for the custom Bazel config.

Fixes: #17106

Signed-off-by: Keith Smiley keithbsmiley@gmail.com

rules_foreign_cc sets this automatically to either Debug or Release
based on bazel's compilation_mode. Overriding this can cause issues when
deps' cmake configs expect to be in a specific subset of configs. Unlike
LLVM most cmake configs seem to silently fail in that case by not
setting an expected var correctly. I hit this issue when updating
rules_foreign_cc (I'm not sure of why the update broke it) and wamr
missing some settings for the custom Bazel config.

Fixes: envoyproxy#17106

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #17679 was opened by keith.

see: more, trace.

@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).

🐱

Caused by: #17679 was opened by keith.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Aug 11, 2021
@keith
Copy link
Member Author

keith commented Aug 11, 2021

Looks like the original reason for adding this is still valid, will try again after #17445 lands if it works without this

Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/wait

cmake_files_dir = "$BUILD_TMPDIR/CMakeFiles",
generate_crosstool_file = False,
**kwargs):
cache_entries.update({"CMAKE_BUILD_TYPE": "Bazel"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does RELWITHDEBINFO work?

@yanavlasov yanavlasov self-assigned this Aug 13, 2021
@wrowe
Copy link
Contributor

wrowe commented Aug 16, 2021

This fix is -not- correct.

Bazel rules_foreign_cc provided all necessary flags to cmake in order to build the targets in exactly the same configuration as envoy itself, which is why a custom, no-op flavor target is used.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 15, 2021
@keith keith closed this Sep 21, 2021
@keith keith deleted the ks/bazel-remove-cmake_build_type-override branch September 21, 2021 22:30
@keith
Copy link
Member Author

keith commented Sep 21, 2021

Makes sense, I could see this causing more issues in the future though. I was thinking that either:

  • using a single configuration would pretty much always make sense (probably relwithdebuginfo)
  • or doing a simple select on dbg vs fastbuild vs opt would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps Approval required for changes to Envoy's external dependencies stale stalebot believes this issue/PR has not been touched recently waiting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow custom values of CMAKE_BUILD_TYPE

3 participants