Code Monkey home page Code Monkey logo

clangbuilder's Introduction

Clangbuilder

Automated tools help developers on Windows platforms building LLVM and clang.

Installation

Clone clangbuilder on Github

git clone https://github.com/fstudio/clangbuilder.git clangbuilder

Click the script/InitializeEnv.bat

The installation script will compile ClangbuilderUI and create a shortcut, download required packages.

Settings

Your can modified settings.json to change your clangbuilder run mode. settings.template.json content like here:

{
  "EnterpriseWDK": "D:\\EWDK",
  "LLVMRoot": "D:\\LLVM",
  "LLVMArch": "x64",
  "PwshCoreEnabled": true,
  "UseWindowsTerminal": true,
  "Conhost": "C:\\Path\\To\\OpenConsole.exe",
  "SetWindowCompositionAttribute": false
}
  • EnterpriseWDK Set EWDK root path and enable Enterprise WDK.
  • LLVMRoot Pre-built llvm installation root directory.
  • LLVMArch Pre-built llvm default architecture
  • PwshCoreEnabled Enable Powershell Core, all script run use pwsh (when you install powershell core).
  • UseWindowsTerminal Use Windows Terminal (We need wt support commandline)
  • Conhost If Windows Termianl not exists, your can set OpenConsole path.
  • SetWindowCompositionAttribute Fluent UI features

Build Clang on Windows

Clangbuilder Now Only support use Visual C++ build Clang LLVM LLDB.

Best Visual Studio Version:

Visual Studio 2019 16.3 or later

You can click to run ClangbuilderUI, Modified Arch, Configuration and other options. after click Building

ClangbuilderUI Snapshot

clangbuilder

Branch

CMake Custom flags

You can custom cmake build flags Now !!!

Clangbuilder will check $ClangbuilderRoot\out\cmakeflags.$Branch.json and $ClangbuilderRoot\out\cmakeflags.json is exists, if exists parse cmake flags.

The corresponding branch takes effect:

cmakeflags.mainline.json
cmakeflags.stable.json
cmakeflags.release.json

Set cmakeflags.json will take effect in all branches (Mainline, Stable, Release)

Flags configuration format is json:

{
    "CMake":[
        "-DCMAKE_INSTALL_PREFIX=\"D:/LLVM\""
    ]
}

Engine

  • MSbuild use msbuild build llvm MSBuild - MSVC
  • Ninja use ninja build llvm Ninja - MSVC
  • NinjaBootstrap use ninja build and bootstrap llvm Ninja - Bootstrap
  • NinjaIterate use ninja build llvm, but compile is prebuilt clang (config by config\prebuilt.json) Ninja - Clang

LLDB

When you select build LLDB, If not found Python 3 installed. Clangbuilder add flag -DLLDB_DISABLE_PYTHON=1.

LLDB maybe not work.

Libc++

Only NinjaBootstrap and NinjaIterate will compile libc++ ,Because Visual C++ not support include_next now.

clang-cl -std:c++14  -Iinclude\c++\v1 hello.cc c++.lib

after copy c++.dll to your path(or exe self directory).

Use Clean Environment

Clangbuilder support Clean Environment, When use -ClearEnv flag or enable check box Use Clean Environment, Clangbuilder will retset $env:PATH.

Function ReinitializePath {
    if ($PSEdition -eq "Desktop" -or $IsWindows) {
        $env:PATH += "${env:windir};${env:windir}\System32;${env:windir}\System32\Wbem;${env:windir}\System32\WindowsPowerShell\v1.0"
    }
    else {
        $env:PATH = "/usr/local/bin:/usr/bin:/bin"
    }
}

Windows Terminal

You can modify UseWindowsTerminal to enable or disable the use of Windows Terminal as the default terminal. When UseWindowsTerminal is set to true, you open the Clangbuilder terminal environment, the screenshot is as follows:

termianl

Custom PATH

You can modify config/initialize.json , add some directories to PATH. Note that directories have higher priority in PATH. (Insert Front)

Suggest

  • Best Platform is Windows 10 x64
  • Select Use Clean Environment will reset current process Environment PATH value, Resolve conflict environment variables
  • If your will build lldb, your should install python3.
$env:Path = "${env:windir};${env:windir}\System32;${env:windir}\System32\Wbem;${env:windir}\System32\WindowsPowerShell\v1.0"

$evn:windir is usually C:\Windows

Add Portable Utilities

baulk is a better Windows package management tool developed by the author

You can port some tools to clangbuilder, see ports and then double-click script/DevAll.bat to the software you need as part of the Clangbuilder is added to the environment. Clangbuilder 6.0 support devi, You can run devi under Environment Console, use devi install $ToolName to install your need tools.

Usage:

devi 7.0 portable package manager
Usage: devi cmd package-name
    list         list installed package
    search       search ported package
    install      install package
    uninstall    uninstall package
    upgrade      upgrade all upgradeable packages
    help         print help message
    version      print devi version and exit

Default installed tools:

{
    "core": [
        "7z",
        "cmake",
        "git",
        "ninja",
        "nsis",
        "nuget",
        "python2",
        "vswhere"
    ]
}

Current ported tools:

7z                  19.00               7-Zip is a file archiver with a high compression ratio
ag                  2019-03-23/2.2....  A code-searching tool similar to ack, but faster.
arc                 3.2                 Introducing Archiver - a cross-platform, multi-format archive utility
aria2               1.35.0              The ultra fast download utility
bat                 v0.12.1             A cat(1) clone with wings.
cmake               3.16.4              CMake is an open-source, cross-platform family of tools designed to build, test and package software
curl                7.68.0              Curl is a command-line tool for transferring data specified with URL syntax.
dmd                 2.090.0             D is a general-purpose programming language with static typing, systems-level access, and C-like syntax
fd                  v7.4.0              A simple, fast and user-friendly alternative to 'find'
git                 2.25.0              Git is a modern distributed version control system focused on speed
hg                  5.3                 Mercurial is a free, distributed source control management tool.
innoextract         1.8                 A tool to unpack installers created by Inno Setup.
innounp             0.49                InnoUnp - Inno Setup Unpacker.
jom                 1.1.3               jom is a clone of nmake
mach2               0.3.0.0             Mach2 manages the Windows Feature Store, where Features (and associated on/off state) live.
nasm                2.14.02             NASM - The Netwide Assembler
neovim              0.4.2               Neovim - Vim-fork focused on extensibility and usability
ninja               1.10.0              Ninja is a small build system with a focus on speed.
nsis                3.05                NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers.
nuget               5.4.0               NuGet is the package manager for .NET. The NuGet client tools provide the ability to produce and consume packages.
openssh             v8.1.0.0p1-Beta     Portable OpenSSH
perl5               5.30.0.1            Perl 5 is a highly capable, feature-rich programming language.
pijul               0.11.0              Pijul is a free and open source (GPL2) distributed version control system.
putty               0.73                PuTTY: a free SSH and Telnet client.
python3             3.5.4               Python is a programming language.
radare              4.0.0               unix-like reverse engineering framework and commandline tools
ripgrep             11.0.2              ripgrep recursively searches directories for a regex pattern.
shfmt               3.0.1               A shell formatter.
swigwin             4.0.1               Simplified Wrapper and Interface Generator
unrar               5.90                Decompress RAR files.
vswhere             2.8.4               Visual Studio Locator.
watchexec           1.11.1              Execute commands in response to file modifications.
wget                1.20.3              A command-line utility for retrieving files using HTTP, HTTPS and FTP protocols.

Extensions:

We support 4 extensions: exe, zip, msi, 7z. If 7z is not installed, only the first three extensions are supported. If you need to port a 7z extension type of package, you need to understand the decompression format supported by 7z.exe.

7z.exe supported formats(Unpacking): AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z

Add Extranl Libs

You can add extranl lib, such as z3, download extranl lib, unpack to bin/external , bin/external/include is include dir, bin/external/lib/$arch(x86,x64,arm,arm64), bin/external/bin/$arch(x86,x64,arm,arm64).

About Ninja Task

Ninja Task Parallel:

Function Parallel() {
    $MemSize = (Get-CimInstance -Class Win32_ComputerSystem).TotalPhysicalMemory
    $ProcessorCount = $env:NUMBER_OF_PROCESSORS
    $MemParallelRaw = $MemSize / 1610612736 #1.5GB
    #[int]$MemParallel = [Math]::Floor($MemParallelRaw)
    [int]$MemParallel = [Math]::Ceiling($MemParallelRaw) ## less 1
    return [Math]::Min($ProcessorCount, $MemParallel)
}

Copyright

License: MIT
Author: Force.Charlie
Copyright © 2022 Force Charlie. All Rights Reserved.

Other

fstudio: Icons made by Smashicons from www.flaticon.com

clangbuilder's People

Contributors

fcharlie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clangbuilder's Issues

Errors produced by script/VisualCppToolsFetch.bat

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

  • ... isualCppToolsVersion"|Out-File -Encoding unicode -Force -Path "$Visua ...
  •                                                         ~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Out-File], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.OutFileCommand

ClangbuilderUI Add Windows 10 Theme support

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);

Selectable Targets to build from UI?

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..

InitializeEnv.bat script fails compilation due to MFC not installed?

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..

End of Central Directory record could not be found - and other errors

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

  • ... ipArchive = New-Object -TypeName System.IO.Compression.ZipArchive -Ar ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
    • FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

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
    
  •                         ~~~~~
    
    • CategoryInfo : InvalidData: (:) [Copy-Item], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CopyItemCommand

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
    
  •                         ~~~~~
    
    • CategoryInfo : InvalidData: (:) [Copy-Item], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CopyItemCommand

Update package completed.

DefaultVisualStudio : Invalid JSON primitive: Visual.
At E:\Documents\Programming\Code\Libraries\clangbuilder\bin\CompileUtils.ps1:9 char:1

  • DefaultVisualStudio -ClangbuilderRoot $ClangbuilderRoot # initialize ...
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DefaultVisualStudio
    
    

E:\Documents\Programming\Code\Libraries\clangbuilder>get

develope win32 console application

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.

Clang Builder fails on Directories with spaces

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"

Could you post a binary build of this tool?

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!

Symlink replace by IO_REPARSE_TAG_APPEXECLINK

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)
 

Support Build LLDB

lldb require build python from sources , so allow clangbuilder build python ...

Build status

2016-07-31 UTC+8 Build compiler-rt under windows,use Visual Stduio 2015, asan, _realloc redefined with libucrt.lib

Can't build clangbuilder

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.

libc++

Helo
You could add in build the libc++!

Invoke-MSBuild : CMake exit: 1

ERROR1:


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

ERROR 2

error 2

Failed to create installation package

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>`

Failed MSI Installation

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

Link error Hello World

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 "int public: __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 :)

compile error relatated json

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());

Support Test Best Mirror URL

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"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.