Skip to content
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

/Zc:inline should be set on by default in the MSVC Windows toolchain #22373

Closed
matt-sm opened this issue May 15, 2024 · 2 comments
Closed

/Zc:inline should be set on by default in the MSVC Windows toolchain #22373

matt-sm opened this issue May 15, 2024 · 2 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: bug

Comments

@matt-sm
Copy link
Contributor

matt-sm commented May 15, 2024

Description of the bug:

Since Visual Studio 14, /Zc:inline has been turned on by default:

https://devblogs.microsoft.com/cppblog/feedback-making-zcinline-default-for-debugrelease-configs-in-14/

But this flag seems to be missing from the default windows toolchain config:

https://github.com/bazelbuild/bazel/blob/master/tools/cpp/windows_cc_toolchain_config.bzl#L659

Migrating an existing VS project to cc_ toolchain can cause a regression.

Which category does this issue belong to?

C++ Rules

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Create a VS (2015 or greater) project and check Configuration Properties -> C/C++ -> Command Line. /Zc:inline is set.

or alternatively

Use the VS generator with a CMake project and open the generated vcproj file in VS. The same flag is set.

Now create a cc_library and bazel build -S //.... This flag is not set.

Which operating system are you running Bazel on?

Windows 10

What is the output of bazel info release?

release 7.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added the team-Rules-CPP Issues for C++ rules label May 15, 2024
@matt-sm matt-sm changed the title /Zc:inline should be set on by default in the MSVC WIndows toolchain /Zc:inline should be set on by default in the MSVC Windows toolchain May 15, 2024
@fmeum
Copy link
Collaborator

fmeum commented May 15, 2024

We could make this possibly breaking change for Bazel 8. Ideally, we would have a feature toggling this behavior so that users broken by it can easily disable it.

Would you be interested in sending a PR?

@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels May 15, 2024
@matt-sm
Copy link
Contributor Author

matt-sm commented May 16, 2024

Created #22392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants