-
Notifications
You must be signed in to change notification settings - Fork 445
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
Simplify Bazel #312
Simplify Bazel #312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a way to not declare platforms in the test (and everyone upstream who uses bzlmod) that would be great.
test/BUILD.bazel
Outdated
"@bazel_tools//tools/cpp:clang-cl": _MSVC_FLAGS, | ||
"@bazel_tools//tools/cpp:msvc": _MSVC_FLAGS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These options don't work unless specifying platforms as far as I know. Example from my previous bzlmod PR https://github.com/Neargye/magic_enum/pull/254/files#diff-e13b51fb7feeb38d3fb7dee88724107c57fb3d4805068b5f8d57a2d0900fb0dc. It'll just fallback to the default.
e.g.
cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
Followed by many errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah shoot. Sorry I missed that. The other one worked without platforms, I take it? Presumably the toolchains set the @bazel_tools//tools/cpp:compiler flag internally?
I think the right move, then, is to re-add the bazelmod rules_cc dependency for tests (only). Seems cleaner than duplicating the config settings and still accomplishes all the previous goals around consuming the library itself. I'll push up a commit that does just that.
588861e
to
ea5b977
Compare
Please see Neargye#309 for context, but this sidesteps the bazel dependencies and cleans up the copts where they're not actually used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on one of my projects and it seems fine to me! 👍 (although I only tested on Windows)
local_path_override(module_name = "magic_enum", path = "..") | ||
|
||
bazel_dep(name = "rules_cc", version = "0.0.8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe put the bazel dep back up top? :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd reordered intentionally, thinking we might want the magic-enum dependency configuration all together for clarity that it's being overridden and quick-skimmability.
But I don't feel super strongly or anything--feel free to change if you feel strongly the other way? Or generally lmk if you think there's a different principle I should be absorbing here.
(I'm assuming from the approval that you don't want to block merging on this, yeah? Still v interested in what you have to say, ofc.)
Thank you, Daniil! |
@Neargye, how imminent is v0.9.5, do you think? Trying to decide whether to switch to commit-by-commit to get things back working w/ Bazel vs backpin/waiting for the next release. |
@cpsauer v0.9.5 is released |
Yay! Thanks :) |
Please see #309 for context, but this sidesteps the bazel dependencies and cleans up the copts where they're not actually used.
Fixes #309