-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unable to Build on Windows and LLVM 17 #217
Comments
@DeveloperPaul123 TBH I haven't reproduced these steps in a while, these days to test if it works on Windows I just run this script from the main project directory (please adjust the prefix inside it): https://github.com/bkryza/clang-uml/blob/master/build.ps1 It's possible that for LLVM 17 on Windows there is slightly different set of required LLVM libraries specified in CMake here. In particular there is an IF: if(MSVC)
if(${LLVM_PACKAGE_VERSION} VERSION_LESS "15.0")
list(REMOVE_ITEM LIBTOOLING_LIBS clangSupport)
else()
list(APPEND LIBTOOLING_LIBS
LLVMWindowsDriver
LLVMWindowsManifest)
endif()
endif(MSVC) So maybe on LLVM 17 it needs to adjusted in yet another way... I'll investigate. |
@DeveloperPaul123 Btw, can you describe what kind of errors do you get if you try to use the existing Also when you say you use LLVM 17 in your project do you mean you link it to your project or you build your project with LLVM 17 (and not MSVC)? |
@bkryza We get errors with compile flags due to the fact that we are using C++23 features (which clang 15 does not support) so it complains about We use LLVM 17 to build our project in addition to MSVC. |
@DeveloperPaul123 Ok, I'll try to reproduce it. |
@DeveloperPaul123 Please try rebuilding with the latest I'm not sure if this will solve all your issues, but at least you should be able to compile |
@bkryza Your changes fixes my issues and I was able to build clang-uml successfully! Thank you so much. Should I file a separate issue with any C++23 related issues with clang-uml? |
If you still have issues yes please. If you specifically have problems with some flags, checkout these options, which allow you to add or remove compilation flags from compile commands database before they are passed to Clang. So for instance if you still get an error about the gnu23 flag just add it to the remove option and add a flag that Clang 17 will accept... |
Ok will do. I'll mention it here and maybe if you think it's worth filing a new issue I can do that too. I was able to successfully generate diagrams with the
|
Ok great, the issue is most likely with the relative path handling code on Windows, maybe with the fact that std::filesystem::canonical() creates an absolute path to c: instead of d: - I'll also look into that. |
Ok great thanks. Let me know if you want me to file a new issue |
Just as a further update, I'm using a new build of clang-uml on a different computer today and I get the same issue as above
But the letter of the drive is different so now it complains about not finding |
@DeveloperPaul123 Ok thanks for the update but this issue is not yet solved, I haven't yet tried to reproduce it (I only have a single C: drive in my Windows VM...) |
@bkryza No worries, just wanted to post the update before I forget. I can try on one other computer that only has 1 hard drive and see if the issue happens there as well. |
@DeveloperPaul123 I've tried to reproduce this issue but couldn't. I've created a dummy C++ project in MSVC on E: drive, added a simple Could you describe in a little more detail your project structure,
[
{
"directory": "E:/clang-uml-tmp/test1/Test1/",
"command": "\"C:/Users/bkryz/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"E:/clang-uml-tmp/test1/Test1/Test1/main.cpp\" -std=c++14 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt\"",
"file": "E:/clang-uml-tmp/test1/Test1/Test1/main.cpp"
}
]
You can redact the names of the files and classes I only need to know how the paths are relative to each other. Also very helpful would be to see the few last lines of |
@bkryza See my responses below.
It is currently in the source tree, under a
This is auto generated by CMake for us when we configure the project. We currently use Ninja as our generator and have
Looks like it contains absolute files paths for
It is in the root of our source directory.
We are not using Output of
|
@DeveloperPaul123 Thanks for the details, I've tried to reproduce, I've created another dummy project with cmake and ninja and it also worked for me, I'll try to figure out what the difference is, but here is my enviornment maybe you'll also notice sth:
|
@DeveloperPaul123 I found one bug in path handling that might have caused it on your environment, but I still wasn't to reproduce it on mine. If possible, could you retry with this branch |
@bkryza I'll give the branch you mentioned a try. Nothing stands out to me as too different except our clang versions (we're using |
@bkryza The branch you mentioned seems to fix the issue! |
…-windows Fix manual parsing of Windows source location paths (#217)
@DeveloperPaul123 Thanks for checking, I've merged it to master. |
@bkryza Thanks for the quick fixes! This resolves all our issues now. Thanks for your help |
Are you planning on a new patch release? I can supply a clang |
@DeveloperPaul123 I've already setup 17.0.6 on my Windows - I'll try to publish a new release by the end of year... |
I've been trying to use
clang-uml
with some of our projects, but we useLLVM
17.x
. After following the build instructions found here, I get the errors below when trying to buildclang-uml
(clang-umllib
builds fine).Versions
clang-uml
:0.4.2
LLVM
:17.0.6
CMake
:3.27.9
Visual Studio
:17.8.3
Error details
The text was updated successfully, but these errors were encountered: