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

[CI] - build fails in Visual Studio 17.6.0 Preview 3.0 - C1214 - Modules conflict with '/Zc:twoPhase-' #25526

Closed
mikeclayton opened this issue Apr 14, 2023 · 6 comments · Fixed by #25759
Assignees
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Bug Something isn't working Priority-1 Bug that is high priority

Comments

@mikeclayton
Copy link
Contributor

mikeclayton commented Apr 14, 2023

Microsoft PowerToys version

0.69.1 / main branch

Installation method

Other (please specify in "Steps to Reproduce")

Running as admin

None

Area(s) with issue?

General

Steps to reproduce

Trying to build PowerToys main branch in Visual Studio 2022 17.6.0 Preview 3.0 gives about 40+ C1214 errors:

image

C1214 - Modules conflict with non-standard behaviour requested via '/c:twoPhase-'

It worked fine on VS2022 17.6.0 Preview 1.0, but started giving this error on two separate laptops when I upgraded them to VS2022 17.6.0 Preview 3.0 earlier today.

Using the "rollback" feature in the Visual Studio Installer to reinstall 17.6.0 Preview 1.0 fixed the issue - I know Preview versions shouldn't be used for production workloads so it's kind of my problem to deal with, but it might be worth checking whether there's a change queued up that could affect building PowerToys if / when it reaches the LTS version of Visual Studio...

Original version - VS2022 17.6.0 Preview 1.0 - working

image

After upgrade - VS2022 17.6.0 Preview 3.0 - build fails with C1214

image

Rollback - VS2022 17.6.0 Preview 1.0 - working again

image

✔️ Expected Behavior

To be able to build PowerToys from source in Visual Studio 17.6.0 Preview 3.0

❌ Actual Behavior

Multiple C1214 errors

Other Software

No response

@mikeclayton mikeclayton added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 14, 2023
@mikeclayton
Copy link
Contributor Author

The release notes for Visual Studio 2022 17.6.0 Preview 3.0 say this:

https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview#summary-of-whats-new-in-this-release-of-visual-studio-2022-version-176-preview-3

Two-phase name lookup (ISO C++ [temp.dep]) is now the default when /std:c++20 or /std:c++17 is specified. Specifying /Zc:twoPhase- is no longer required with /std:c++17. Managed templates and generics are an exception and will be compiled as before, without two-phase lookup semantics.

which looks like it's related...

@mikeclayton
Copy link
Contributor Author

I've found a machine that has VS2022 17.6.0 Preview 2.0 on it, and that builds fine as well so it looks like Preview 3.0 is the problem...

image

Also, changing either of these settings in C++ projects with Preview 3.0 fixes the build error, but I don't know if that would cause other issues:

  • Changing the "C++ Language Standard" setting to "ISO C++20 Standard (/std:c++20)" fixes the issue:

image

  • Separately, changing the "Build ISO C++23 Standard Library Modules" setting to "No" fixes the issue

image

@crutkas
Copy link
Member

crutkas commented Apr 15, 2023

@snickler has some info on this

@crutkas crutkas added Priority-1 Bug that is high priority Area-Build Issues pertaining to the build system, CI, infrastructure, meta and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 15, 2023
@mikeclayton mikeclayton changed the title [CI] - build fails in Visual Studio 17.6.0 Preview 3.0 - C1214 - Modules conflict with '/Zc:twoPhase' [CI] - build fails in Visual Studio 17.6.0 Preview 3.0 - C1214 - Modules conflict with '/Zc:twoPhase-' Apr 15, 2023
@snickler
Copy link
Collaborator

@mikeclayton - Great find on the Build ISO C++23 Standard Library Modules option. Glad to see there's more people testing with the VS Previews. I ran into the same exact issue and partially got around some of the build issues, only to encounter more - but this option is the thing I was missing. I'll get a fix rolling for this!

@mikeclayton
Copy link
Contributor Author

@snickler - cheers, although tbh I don't properly understand what either of those settings actually do other than what I read on the documentation pages a couple of days ago :-)

I'm not really a C / C++ developer so my comment was meant more as an observation of what happened when I tried messing with some settings rather than a suggestion of what to do to fix the issue. but if it does the job then it's all good...

@snickler
Copy link
Collaborator

@snickler - cheers, although tbh I don't properly understand what either of those settings actually do other than what I read on the documentation pages a couple of days ago :-)

I'm not really a C / C++ developer so my comment was meant more as an observation of what happened when I tried messing with some settings rather than a suggestion of what to do to fix the issue. but if it does the job then it's all good...

That looks to be exactly what I was looking for in terms of making builds work again with 17.6 Preview 3. I currently have everything building properly by setting <BuildStdModules>false</BuildStdModules> so it doesn't build using modules, but looking through the documentation there may be some improvements that C++ modules could provide us in the long run which may help improve build times overall 🤔🤔.

@crutkas - What are your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Bug Something isn't working Priority-1 Bug that is high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants