Comments (6)
All SDK files are lowercased after installaiton.
CMake/Ninja uses output of
/showIncludes
for dependency information.Currently Ninja keep recompiling when the source code contains uppercase header files, as those files are not exist actually (checked with
ninja -d explain
).E.g. most commonly used
#include <Windows.h> #include <GL/gl.h>
Thanks for the report; for this case I think I add an exception to keep GL/gl.h
capitalized in that way.
Overall I don't think we should try to lowercase the output from /showIncludes
- that would break dependencies for user code that uses uppercase file names or directories (unless we'd make the lowercasing even more complex by trying to distinguish between what's SDK headers and what's user headers). MSVC actually used to have a bug that did that, see https://developercommunity.visualstudio.com/t/showIncludes-lowercases-some-path-segme/233871 for context.
I guess you might be familiar with the reason for lowercasing the SDK files, but just for clarity - there's two or three reasons, somewhat interlinked:
- The WinSDK headers in the unmodified form aren't self-consistent. E.g.
Windows.h
as the file is named on disk, but it's mentioned 531 times with the namewindows.h
while only 7 times asWindows.h
. Other headers also have the same issue, and some headers are even spelled in many various forms. This has implications in various forms with respect to the issue you're describing - anytime you'd include a SDK header that included another one with non-canonical spelling, you'd hit this issue. - While MSVC is case insensitive (thanks to Wine in this case), clang-cl is case sensitive by default, so the headers that are inconsistent would simply not work there. So either they have to be lowercased, or one can configure Clang to use a VFS mapping that makes it case insensitive.
- Mingw based toolchains are case sensitive by default, and they ship mostly lowercase headers. So any code that wants to be compileable with mingw toolchains need to refer to the headers by their lowercase name anyway.
So going forward, the main thing I can recommend is to include them with their lowercase name; that makes your code more compatible with mingw toolchains too.
GL/gl.h
is an exception to that, as that's a header that is used with that exact spelling across other case sensitive systems too, and mingw toolchains ship the header with that name as well. So I should make an exception to the lowercasing process to keep that one intact.
Therefore, both due to user code that can use upper case names, and due to exceptions (that aren't handled yet but that I should do) like GL/gl.h
, I don't think we should forcibly lowercase the dependency info output.
Another potential workaround is to make ninja case insensitive for such dependencies. I have a patch that does that, but it's not upstreamed and I'm pretty sure they don't want to merge it; see mstorsjo/ninja@ba931c1.
from msvc-wine.
Thanks for detailed clarification! I had never realized these reasons.
add an exception to keep
GL/gl.h
capitalized
I woud appreciate very much . But I think Windows.h
is also worth being an exception too. It is so old a header file with the uppercased name and it is unavoidable for programming for Windows platform. It is hard to change third parties' code, e.g. https://github.com/ocornut/imgui/blob/13931fd8516e0ee8425cf82dc5eca020a76e7b3c/imgui.cpp#L919-L923.
unless we'd make the lowercasing even more complex by trying to distinguish between what's SDK headers and what's user headers
What about adding a new sed
expression s|^\(Note: including file:\s*/opt/msvc\)\(.*\)|\1\L\2|
from msvc-wine.
But I think
Windows.h
is also worth being an exception too. It is so old a header file with the uppercased name and it is unavoidable for programming for Windows platform. It is hard to change third parties' code, e.g. https://github.com/ocornut/imgui/blob/13931fd8516e0ee8425cf82dc5eca020a76e7b3c/imgui.cpp#L919-L923.
We can't leave it uppercased as Windows.h
as that breaks all the code that includes it with all lowercase, if using clang-cl. But I guess I could consider making a exception, where we leave a symlink so it's accessible with both names.
On that topic, I guess it's could potentially be possible to leave all headers intact with both all-lowercase and original case by adding symlinks for all of them. Or we could at least make an option for that form.
unless we'd make the lowercasing even more complex by trying to distinguish between what's SDK headers and what's user headers
What about adding a new
sed
expressions|^\(Note: including file:\s*/opt/msvc\)\(.*\)|\1\L\2|
I'm not really a fan of that; the toolchain can be installed anywhere, and can be moved around freely after being set up.
from msvc-wine.
we leave a symlink so it's accessible with both names
Yeah, that is what in my mind but I didn't express it clearly.
the toolchain can be installed anywhere, and can be moved around freely after being set up
can use the variable?
Line 19 in 635a3aa
from msvc-wine.
the toolchain can be installed anywhere, and can be moved around freely after being set up
can use the variable?
Line 19 in 635a3aa
I guess we could use that variable, but I'd rather not go that way. I guess #61 should be enough to fix the problems you're having?
from msvc-wine.
@mstorsjo Thanks! The PR solved my issue.
from msvc-wine.
Related Issues (20)
- cl preferring WindowsSDK Headers over custom headers. HOT 1
- runnig install.sh - permission denied HOT 2
- Wine: "build_command_line command line too long" HOT 6
- Trying to get MSBuild working in a Fedora container HOT 16
- msbuild uses HostX86 tools when cross-compiling on x64 host and UseEnv=false HOT 2
- netfx 4.8
- Suggestion: Using GitHub cache action to cache the downloaded files between CI runs HOT 3
- CMake Find Packages HOT 2
- Problem with closing piped output due to msvctricks.exe HOT 1
- Getting "C1902: Program database manager mismatch" when using CMake HOT 3
- MSBuild HOT 1
- Extracting Application Verifier arm External Package (DesktopEditions)-arm_en-us.msi HOT 2
- Build failed when making VS2017, VS2019 docker image HOT 1
- LIB environmental variable needs : and not ; HOT 2
- Clangd Integration
- Absolute paths in response files also need to be handled HOT 4
- vsdownload.py: option to download compiler HOT 3
- LINK error if response files are huge HOT 2
- How to download v143 toolset? HOT 1
- there seems to be no wine64 in ubuntu23.10 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msvc-wine.