fstudio / clangbuilder Goto Github PK
View Code? Open in Web Editor NEWBuilding Clang ♡ Utility and Environment
Home Page: https://fstudio.github.io/clangbuilder/
License: MIT License
Building Clang ♡ Utility and Environment
Home Page: https://fstudio.github.io/clangbuilder/
License: MIT License
Console Output to UTF8
$env:VSLANG=1033
Rewrite Build and Install Feature, Remove some files
main.cc
[ 68%] Building CXX object ui/CMakeFiles/ClangbuilderUI.dir/appexec.cc.obj
appexec.cc
[ 71%] Building CXX object ui/CMakeFiles/ClangbuilderUI.dir/appui.cc.obj
appui.cc
[ 73%] Building CXX object ui/CMakeFiles/ClangbuilderUI.dir/settings.cc.obj
settings.cc
D:\Build\clangbuilder\sources\.\include\json.hpp(20665): error C2416: 不能在此上下文中应用属性 "deprecated("Since 3.0.0")"
D:\Build\clangbuilder\sources\.\include\json.hpp(22608): note: 参见对正在编译的 类 模板 实例化 "nlohmann::basic_json<ObjectType,ArrayType,StringType,BooleanType,NumberIntegerType,NumberUnsignedType,NumberFloatType,AllocatorType,JSONSerializer>" 的引用
D:\Build\clangbuilder\sources\.\include\json.hpp(20913): error C2416: 不能在此上下文中应用属性 "deprecated("Since 3.0.0")"
NMAKE : fatal error U1077: “C:\PROGRA~2\MICROS~1\2017\BUILDT~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe”: 返回代
码“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"”: 返回代 码“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"”: 返回代 码“0x2”
Stop.
devi: Use upgrade --default, will install devi.json#core.
aria2 is a great download tool, we can use it as additional download tool. If you have a different view, you can comment.
May be allow to build cling as well?
Hello :)
I'm having trouble on two different machines. I can't get rc.exe
to work properly. The instructions did not work for me.
I'm wondering if you could release a build of this tool to the releases
tab on github?
Thanks!
We need to support VisualCppTools
Nuget sources: http://vcppdogfooding.azurewebsites.net/nuget/
extract icon and create launcher with icon
-DLLVM_ENABLE_ASSERTIONS=OFF
running .\script\InitializeEnv.bat fails:
\clangbuilder-master\tools\clangbuilderui\MainWindow.h(9): fatal error C1083: No se puede abrir e archivo incluir: 'atlbase.h': No such file or directory
I have no MFC Visual Studio 2017 installed.. it's needed?
can you remove dependency?
thanks..
Windows 10 support create APPEXECLINK,
#define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L) // winnt
#define IO_REPARSE_TAG_HSM (0xC0000004L) // winnt
#define IO_REPARSE_TAG_DRIVE_EXTENDER (0x80000005L)
#define IO_REPARSE_TAG_HSM2 (0x80000006L) // winnt
#define IO_REPARSE_TAG_SIS (0x80000007L) // winnt
#define IO_REPARSE_TAG_WIM (0x80000008L) // winnt
#define IO_REPARSE_TAG_CSV (0x80000009L) // winnt
#define IO_REPARSE_TAG_DFS (0x8000000AL) // winnt
#define IO_REPARSE_TAG_FILTER_MANAGER (0x8000000BL)
#define IO_REPARSE_TAG_SYMLINK (0xA000000CL) // winnt
#define IO_REPARSE_TAG_IIS_CACHE (0xA0000010L)
#define IO_REPARSE_TAG_DFSR (0x80000012L) // winnt
#define IO_REPARSE_TAG_DEDUP (0x80000013L) // winnt
#define IO_REPARSE_TAG_APPXSTRM (0xC0000014L)
#define IO_REPARSE_TAG_NFS (0x80000014L) // winnt
#define IO_REPARSE_TAG_FILE_PLACEHOLDER (0x80000015L) // winnt
#define IO_REPARSE_TAG_DFM (0x80000016L)
#define IO_REPARSE_TAG_WOF (0x80000017L) // winnt
#define IO_REPARSE_TAG_WCI (0x80000018L) // winnt
#define IO_REPARSE_TAG_WCI_1 (0x90001018L) // winnt
#define IO_REPARSE_TAG_GLOBAL_REPARSE (0xA0000019L) // winnt
#define IO_REPARSE_TAG_CLOUD (0x9000001AL) // winnt
#define IO_REPARSE_TAG_CLOUD_1 (0x9000101AL) // winnt
#define IO_REPARSE_TAG_CLOUD_2 (0x9000201AL) // winnt
#define IO_REPARSE_TAG_CLOUD_3 (0x9000301AL) // winnt
#define IO_REPARSE_TAG_CLOUD_4 (0x9000401AL) // winnt
#define IO_REPARSE_TAG_CLOUD_5 (0x9000501AL) // winnt
#define IO_REPARSE_TAG_CLOUD_6 (0x9000601AL) // winnt
#define IO_REPARSE_TAG_CLOUD_7 (0x9000701AL) // winnt
#define IO_REPARSE_TAG_CLOUD_8 (0x9000801AL) // winnt
#define IO_REPARSE_TAG_CLOUD_9 (0x9000901AL) // winnt
#define IO_REPARSE_TAG_CLOUD_A (0x9000A01AL) // winnt
#define IO_REPARSE_TAG_CLOUD_B (0x9000B01AL) // winnt
#define IO_REPARSE_TAG_CLOUD_C (0x9000C01AL) // winnt
#define IO_REPARSE_TAG_CLOUD_D (0x9000D01AL) // winnt
#define IO_REPARSE_TAG_CLOUD_E (0x9000E01AL) // winnt
#define IO_REPARSE_TAG_CLOUD_F (0x9000F01AL) // winnt
#define IO_REPARSE_TAG_CLOUD_MASK (0x0000F000L) // winnt
#define IO_REPARSE_TAG_APPEXECLINK (0x8000001BL) // winnt
#define IO_REPARSE_TAG_PROJFS (0x9000001CL) // winnt
#define IO_REPARSE_TAG_LX_SYMLINK (0xA000001DL)
#define IO_REPARSE_TAG_STORAGE_SYNC (0x8000001EL) // winnt
#define IO_REPARSE_TAG_WCI_TOMBSTONE (0xA000001FL) // winnt
#define IO_REPARSE_TAG_UNHANDLED (0x80000020L) // winnt
#define IO_REPARSE_TAG_ONEDRIVE (0x80000021L) // winnt
#define IO_REPARSE_TAG_PROJFS_TOMBSTONE (0xA0000022L) // winnt
#define IO_REPARSE_TAG_AF_UNIX (0x80000023L) // winnt
/// Windows Subsystem for Linux
#define IO_REPARSE_TAG_LX_FIFO (0x80000024L)
#define IO_REPARSE_TAG_LX_CHR (0x80000025L)
#define IO_REPARSE_TAG_LX_BLK (0x80000026L)
https://clang.llvm.org/docs/ThinLTO.html
-DLLVM_ENABLE_LTO=Thin
-DCMAKE_C_COMPILER=/path/to/host/clang-cl.exe
-DCMAKE_CXX_COMPILER=/path/to/host/clang-cl.exe
-DCMAKE_LINKER=/path/to/host/lld-link.exe
-DCMAKE_RANLIB=/path/to/host/llvm-ranlib.exe
-DCMAKE_AR=/path/to/host/llvm-ar.exe
When I use the json.hpp whose version is 3.7.0, there are some error in the following lines:
"auto j = nlohmann::json::parse(fd.P());", the function nlohmann::json::parse cannot process the return value of fd.P()
//sources\cli\cli.cc:
auto file = bela::StringCat(root, L"\config\settings.json");
clangbuilder::FD fd;
if (_wfopen_s(&fd.fd, file.data(), L"rb") != 0) {
return false;
}
try {
auto j = nlohmann::json::parse(fd.P());
as this can improve build speed greatly could be good to be able to select LLVM targets for example common "X86;NVPTX" for POCL CUDA support for example..
Hi Charlie,
I now have it building successfully but the 'Create Installation Package' part failed.
Here is the tail end of the logging:
` C:\clangbuilder\out\mainline\tools\lldb\tools\lldb-mi\MICmnLLDBDebuggerHandleEvents.cpp(265): warning C4062: enumerator 'lldb::eBreakpointEventTypeAutoContinueChanged' in switch of enum 'lldb::BreakpointEventType' is not handled [C:
\clangbuilder\out\msbuild\tools\lldb\tools\lldb-mi\lldb-mi.vcxproj]
35 Warning(s)
0 Error(s)
Time Elapsed 01:23:51.60
Build llvm completed, your can run cpack
CPack: Create package using NSIS
CPack: Install projects
CPack: - Install project: LLVM
CMake Error in C:/clangbuilder/out/msbuild/projects/compiler-rt/lib/cmake_install.cmake:
File starts with a Byte-Order-Mark that is not UTF-8.
Call Stack (most recent call first):
C:/clangbuilder/out/msbuild/projects/compiler-rt/cmake_install.cmake:33 (include)
C:/clangbuilder/out/msbuild/projects/cmake_install.cmake:32 (include)
C:/clangbuilder/out/msbuild/cmake_install.cmake:105 (include)
CMake Error at C:/clangbuilder/out/msbuild/projects/compiler-rt/cmake_install.cmake:33 (include):
include could not find load file:
C:/clangbuilder/out/msbuild/projects/compiler-rt/lib/cmake_install.cmake
Call Stack (most recent call first):
C:/clangbuilder/out/msbuild/projects/cmake_install.cmake:32 (include)
C:/clangbuilder/out/msbuild/cmake_install.cmake:105 (include)
Creating llvm-ranlib.exe
Creating llvm-lib.exe
Creating llvm-dlltool.exe
Creating clang++.exe
Creating clang-cl.exe
Creating clang-cpp.exe
Creating ../msbuild-bin/cl.exe
Creating lld-link.exe
Creating ld.lld.exe
Creating llvm-readelf.exe
CPack Error: Error when generating package: LLVM
compile llvm done, you can use it
PS C:\clangbuilder\out\msbuild>`
2016-07-31 UTC+8 Build compiler-rt under windows,use Visual Stduio 2015, asan, _realloc redefined with libucrt.lib
Hi, I tried your bootstrap batch file (script/InitializeEnv.bat) and get the following errors
Install new GNUWin: 1.0 ...
Download http://downloads.sourceforge.net/projects/clangonwin/files/Install/Packages/ClangSetup-Package-GnuWin-win32.zip ...
New-Object : Exception calling ".ctor" with "3" argument(s): "End of Central Directory record could not be found."
At
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:933
char:23
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Install new Ninja: 1.7.2 ...
Download https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip ...
Install new swigwin: 3.0.11 ...
Download https://downloads.sourceforge.net/project/swig/swigwin/swigwin-3.0.11/swigwin-3.0.11.zip ...
Install new vswhere: 2.1.3 ...
Download https://github.com/Microsoft/vswhere/releases/download/2.1.3/vswhere.exe ...
Directory: E:\Documents\Programming\Code\Libraries\clangbuilder\pkgs
Mode LastWriteTime Length Name
d----- 11/09/2017 19:56 vswhere
Copy-Item : Cannot bind argument to parameter 'Path' because it is null.
At E:\Documents\Programming\Code\Libraries\clangbuilder\modules\PM\PM.psm1:198 char:29
Copy-Item -Path $File -Destination $NewDir -Force
~~~~~
Install new NuGet: 4.3.0 ...
Download https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe ...
d----- 11/09/2017 19:57 NuGet
Copy-Item : Cannot bind argument to parameter 'Path' because it is null.
At E:\Documents\Programming\Code\Libraries\clangbuilder\modules\PM\PM.psm1:198 char:29
Copy-Item -Path $File -Destination $NewDir -Force
~~~~~
Update package completed.
DefaultVisualStudio : Invalid JSON primitive: Visual.
At E:\Documents\Programming\Code\Libraries\clangbuilder\bin\CompileUtils.ps1:9 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DefaultVisualStudio
E:\Documents\Programming\Code\Libraries\clangbuilder>get
When cmake gen build file, after it exit, if start vctip.exe , Powershell (Start-Process) wait to vctip exit.
vctip start as a job.
Hi,
When I execute install.bat, there are some errors (specifically in installation of msi files):
PS C:\Users\user\Desktop\clangbuilder> ./install.bat
C:\Users\user\Desktop\clangbuilder\tools\RestoreUtilitytools.ps1 : Not Found any support visual studio
At C:\Users\user\Desktop\clangbuilder\bin\Installer.ps1:20 char:1
+ . "$ClangbuilderRoot/tools/RestoreUtilitytools.ps1"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,RestoreUtilitytools.ps1
1
MinGit is up to date !
CMake is up to date !
Initializing Python
Downloading Python ...
Expand-Msi : Invoke msiexec expend package: Python.msi failed !
At C:\Users\user\Desktop\clangbuilder\bin\PkgInitialize.ps1:135 char:13
+ Expand-Msi -Path $File -DestinationPath $Name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Expand-Msi
False
Initializing Subversion
Downloading Subversion ...
Expand-Msi : Invoke msiexec expend package: Subversion.msi failed !
At C:\Users\user\Desktop\clangbuilder\bin\PkgInitialize.ps1:135 char:13
+ Expand-Msi -Path $File -DestinationPath $Name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Expand-Msi
False
NSIS is up to date !
GNUWin is up to date !
Ninja is up to date !
swigwin is up to date !
vswhere is up to date !
I run the script as administrator of my machine. I've not yet installed Microsoft Visual Studio.
I tried to install them manually (by requesting URL contained in config/packages.json) in pkgs folder but it seems that the script don't recognize them. Any idea to fix this ?
P.S: URL of Tortoise Subversion isn't working. This URL is working for version 1.9.4 : https://sourceforge.net/projects/tortoisesvn/files/1.9.4/Application/TortoiseSVN-1.9.4.27285-x64-svn-1.9.4.msi/download
Reference:
Allow for transparent / vibrant window theme
Windows 10 Fluent Design / Acrylic material
Adding the "Aero Glass" blur to your Windows 10 apps
https://github.com/arkenthera/electron-vibrancy/blob/master/src/vibrancy_win.cc
public enum AccentState
{
ACCENT_DISABLED = 0, // Black and solid background
ACCENT_ENABLE_GRADIENT = 1, // Custom-colored solid background
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, // Custom-colored transparent background
ACCENT_ENABLE_BLURBEHIND = 3, // Custom-colored and blurred transparent background
ACCENT_ENABLE_FLUENT = 4, // Custom-colored Fluent effect
ACCENT_INVALID_STATE = 5 // Completely transparent background
}
HWND hWnd = FindWindow("Chrome_WidgetWin_1", NULL);
ACCENTPOLICY policy = { 4, 2, 0xaa000000, 0 }; // ACCENT_ENABLE_FLUENT=4
WINCOMPATTRDATA data = { 19, &policy, sizeof(ACCENTPOLICY) }; // WCA_ACCENT_POLICY=19
SetWindowCompositionAttribute(hWnd, &data);
Devi need support Mutex.
This binary release can build win32 application by using win32 api without visual studio , can't it ? That mean it already include indepent windows lib. If not , it is expected.
Code support PowerShell Core, and batch launcher support config.
This is a feature, should support build log
Add 7z,rar format archive support. use 7z(?)
Get best url from a url array
#!/usr/bin/env pwsh
function TestTcpConnection {
Param(
[string]$ServerName,
$Port = 80,
$Count = 0,
$WaitFor = 1000
)
try {
$ResponseTime = [System.Double]::MaxValue
$tcpclient = New-Object system.Net.Sockets.TcpClient
$stopwatch = New-Object System.Diagnostics.Stopwatch
$stopwatch.Start()
$tcpConnection = $tcpclient.BeginConnect($ServerName, $Port, $null, $null)
$ConnectionSucceeded = $tcpConnection.AsyncWaitHandle.WaitOne(3000, $false)
$stopwatch.Stop()
$ResponseTime = $stopwatch.Elapsed.TotalMilliseconds
if (!$ConnectionSucceeded) {
$tcpclient.Close()
}
else {
$tcpclient.EndConnect($tcpConnection) | out-Null
$tcpclient.Close()
}
return $ResponseTime
}
catch {
return [System.Double]::MaxValue
}
}
Function Test-BestSourcesURL {
param(
[String[]]$Urls
)
[System.String]$besturl = $null;
[System.Double]$pretime = [System.Double]::MaxValue
[int]$index = 0
for ($i = 0; $i -lt $Urls.Count; $i++) {
$u = $Urls[$i]
$xuri = [uri]$u
$resptime = TestTcpConnection -ServerName $xuri.Host -Port $xuri.Port
Write-Host "$u response time: $resptime ms"
if ($pretime -gt $resptime) {
$index = $i
$pretime = $resptime
}
}
return $Urls[$index]
}
$urls = "https://storage.googleapis.com/golang", "https://studygolang.com/dl/golang"
$burl = Test-BestSourcesURL -Urls $urls
if ($burl -ne $null) {
Write-Host -ForegroundColor Green "Best URL: $burl"
}
Hello,
I'm trying to bring LLVM tool chain (with libc++) to Window because my coworkers work on it and I'd like to be able to use some C++17, Boost Hana... That kind of thing.
I followed the readme, Trying to use VS Community 2017, x64, Release, Stable, Ninja Boostrap, Use Clean Environment, Link static runtime library, Build LLDB.
But after that I tried to compile a simple Hello world:
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
And got link warnings:
PS D:\clangbuilder\out\bootstrap> .\bin\clang.exe .\test.cpp
test-553061.o : warning LNK4217: locally defined symbol _CxxThrowException imported in function "class std::num_put<char,class std::ostreambuf_iterator<char,struct std::char_traits > > const & __cdecl std::use_facet<class std::num_put<char,class std::ostreambuf_iterator<char,struct std::char_traits > > >(class std::locale const &)" (??$use_facet@V?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@@std@@YAAEBV?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@0@AEBVlocale@0@@z)
test-553061.o : warning LNK4217: locally defined symbol __std_terminate imported in function "intpublic: __cdecl std::locale::~locale(void)'::
1'::dtor$6" (?dtor$6@?0???1locale@std@@qeaa@XZ@4HA)
PS D:\clangbuilder\out\bootstrap>
I tried some things, like this one : https://llvm.org/docs/GettingStartedVS.html
But still link warnings.
And I don't even know how to link to libc++ x)
That's probably not into the scope of this project, but I think a documentation about the whole installation would be useful for dumb people like me :)
Helo
You could add in build the libc++!
commit: 79cadcf support
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64"
CMake maybe find Fixed Visual C++
I'm wondering if there is a fully scripted way to build clang
without needing the UI?
lldb require build python from sources , so allow clangbuilder build python ...
Happened to place your tool under the default "Visual Studio 2017" location, but when I hit building the Powershell script didn't understand the path
I got round it by creating a VS2017 junction into "Visual Studio 2017"
devi uninstall toolname
When I run the script it produces the following errors:
Installing VisualCppTools.Community.Daily.D14Layout 14.11.25617-Pre.
Adding package 'VisualCppTools.Community.Daily.D14Layout.14.11.25617-Pre' to folder 'E:\Documents\Programming\Code\Libraries\clangbuilder\utils\msvc'
Added package 'VisualCppTools.Community.Daily.D14Layout.14.11.25617-Pre' to folder 'E:\Documents\Programming\Code\Libraries\clangbuilder\utils\msvc'
Successfully installed 'VisualCppTools.Community.Daily.D14Layout 14.11.25617-Pre' to E:\Documents\Programming\Code\Libraries\clangbuilder\utils\msvc
Executing nuget actions took 30.56 min
Out-File : A parameter cannot be found that matches parameter name 'Path'.
At E:\Documents\Programming\Code\Libraries\clangbuilder\bin\DownloadDailyCompiler.ps1:85 char:95
~~~~~
Clangbuilder UI run under my Surface Pro 4, DPI Scaling 200%, Layout is broken !.
Invoke-MSBuild : CMake exit: 1
Location C:\clangbuilder-master\bin\ClangbuilderTarget.ps1:306 字符: 21
+ $MyResult = Invoke-MSBuild
+ ~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-MSBuild
Engine: MSBuild, Result: 1
ClangbuilderUI can find BuildTools, but ps module cannot resolve.
When wt supports more command line arguments, ClangbuilderUI will support Environment Console to be opened with Windows Terminal.
TODO.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.