-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
visualstudio.py: Don't error out when removing /utf-8 (fix regression) #10470
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10470 +/- ##
==========================================
- Coverage 68.71% 67.22% -1.50%
==========================================
Files 406 203 -203
Lines 87868 43911 -43957
Branches 19522 9768 -9754
==========================================
- Hits 60379 29517 -30862
+ Misses 22918 12139 -10779
+ Partials 4571 2255 -2316
Continue to review full report at Codecov.
|
This indicates that the original implementation was wrong because it mutated state shared between multiple compilers. The solution here isn't to catch and ignore the exception, but rather to fix this leaky behavior. |
52e4ccd
to
aab4c7f
Compare
Hi @eli-schwartz, Thanks for the notes... OK, so I guess I will try my best in doing this. So, maybe instead of removing the Anyways, not sure about the CI failings due to the brownouts... |
Test failures seem relevant. In general, the underlying problem is the same whether you add them when wanted, or remove them when not wanted. Namely, that one way or another a shared class attribute is getting modified in a manner that affects other instances, for example this could result in bad command lines where one instance does support /utf-8 and one does not. |
76ece7c
to
217f07c
Compare
Hi @eli-schwartz, Thanks for the lesson in Python on shared class attributes...:)! Let's see how CI looks at the code. |
If this logic works, then setting it instead as |
In PR 10263, we didn't account for that we may have initialize the Visual Studio-like compiler two times, once for a C compiler and once for the C++ compiler, so we end up with Meson breaking on Visual Studio 2013 or earlier, such as when building GLib. Fix this by setting up the always_args member of the VisualStudioLikeCompiler instance during __init__() as needed, so that we avoid falling into modifying shared objects.
217f07c
to
e3664fb
Compare
Hi @eli-schwartz, Indeed it is, interesting things in Python... :) |
Hi,
From the commit message:
In PR 10263, we didn't account for that we may initialize the Visual Studio-like compiler two times, once for a C compiler and once for the C++ compiler, so we end up with Meson breaking on Visual Studio 2013 or earlier, such as when building GLib.
Fix this by checking for a ValueError, just like what we did when /[source|execution]-charset:... is specified, , so that we do not error out when we have already removed /utf-8 from the set of always-used compiler arguments.
With blessings, thank you!