Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 16b3464

Browse files
Merge branch 'main' into sccarda/StatementKinds
2 parents 9bb83dd + c3d82f0 commit 16b3464

File tree

216 files changed

+26320
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+26320
-399
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ paket-files/
306306
__pycache__/
307307
*.pyc
308308

309+
# Python Virtual environments
310+
*__venv/
311+
309312
# Cake - Uncomment if you are using it
310313
# tools/**
311314
# !tools/packages.config

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "src/Passes/vendors/googletest"]
2+
path = src/Passes/vendors/googletest
3+
url = https://github.com/google/googletest.git
4+
shallow = true

QsCompiler.sln

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Tests.CSharpGeneration", "s
6565
EndProject
6666
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGeneration", "CodeGeneration", "{160AABCE-2317-4695-815C-D3B3F88BE780}"
6767
EndProject
68+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formatter", "Formatter", "{755A6971-AD80-4519-A64E-0333B89C1E9D}"
69+
EndProject
70+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Parser", "src\QsFmt\Parser\Parser.csproj", "{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}"
71+
EndProject
72+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter", "src\QsFmt\Formatter\Formatter.fsproj", "{4D1F507F-7382-4F5B-9923-58398A565D8B}"
73+
EndProject
74+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App", "src\QsFmt\App\App.fsproj", "{AD350766-EE10-4DE3-A834-129D026487FB}"
75+
EndProject
6876
Global
6977
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7078
Debug|Any CPU = Debug|Any CPU
@@ -387,6 +395,42 @@ Global
387395
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x64.Build.0 = Release|Any CPU
388396
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.ActiveCfg = Release|Any CPU
389397
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.Build.0 = Release|Any CPU
398+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
399+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
400+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.ActiveCfg = Debug|Any CPU
401+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.Build.0 = Debug|Any CPU
402+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.ActiveCfg = Debug|Any CPU
403+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.Build.0 = Debug|Any CPU
404+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
405+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.Build.0 = Release|Any CPU
406+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.ActiveCfg = Release|Any CPU
407+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.Build.0 = Release|Any CPU
408+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.ActiveCfg = Release|Any CPU
409+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.Build.0 = Release|Any CPU
410+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
411+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
412+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.ActiveCfg = Debug|Any CPU
413+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.Build.0 = Debug|Any CPU
414+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.ActiveCfg = Debug|Any CPU
415+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.Build.0 = Debug|Any CPU
416+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
417+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.Build.0 = Release|Any CPU
418+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.ActiveCfg = Release|Any CPU
419+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.Build.0 = Release|Any CPU
420+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.ActiveCfg = Release|Any CPU
421+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.Build.0 = Release|Any CPU
422+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
423+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
424+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.ActiveCfg = Debug|Any CPU
425+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.Build.0 = Debug|Any CPU
426+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.ActiveCfg = Debug|Any CPU
427+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.Build.0 = Debug|Any CPU
428+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
429+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.Build.0 = Release|Any CPU
430+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.ActiveCfg = Release|Any CPU
431+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.Build.0 = Release|Any CPU
432+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.ActiveCfg = Release|Any CPU
433+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.Build.0 = Release|Any CPU
390434
EndGlobalSection
391435
GlobalSection(SolutionProperties) = preSolution
392436
HideSolutionNode = FALSE
@@ -407,6 +451,9 @@ Global
407451
{2BCE252C-DCE8-48A6-B08C-E5DDD753506C} = {160AABCE-2317-4695-815C-D3B3F88BE780}
408452
{B08BB875-89AF-4194-AC13-D8FB8290B54E} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
409453
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
454+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
455+
{4D1F507F-7382-4F5B-9923-58398A565D8B} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
456+
{AD350766-EE10-4DE3-A834-129D026487FB} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
410457
EndGlobalSection
411458
GlobalSection(ExtensibilityGlobals) = postSolution
412459
SolutionGuid = {B921C36B-4574-4025-8FE3-E5BD2D3D2B81}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ If you edit the [Microsoft.Quantum.Sdk](./src/QuantumSdk) as part of your change
7373
```
7474
dotnet publish src/QuantumSdk/Tools/Tools.sln -c Debug
7575
dotnet publish src/QsCompiler/CommandLineTool/CommandLineTool.csproj -c Debug
76+
dotnet publish src/QsFmt/App/App.fsproj -c Debug
7677
nuget.exe pack src/QuantumSdk/QuantumSdk.nuspec -Version 1.0.0 -Properties Configuration=Debug
7778
```
7879
Move the created .nupkg file into your [local NuGet folder](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds). You can now use the package to build any Q# project by opening the project file in a text editor, and editing the Sdk version number in the first line to be

build/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,27 @@ schedules:
2626
- main
2727
always: true
2828

29-
pool:
30-
vmImage: windows-latest
3129

3230
jobs:
3331
- job: Build
3432
steps:
3533
- template: init.yml
3634
- template: steps.yml
3735
- template: wrap-up.yml
36+
pool:
37+
vmImage: windows-latest
38+
39+
- job: LinuxBuild
40+
steps:
41+
- template: passes-linux.yml
42+
pool:
43+
vmImage: ubuntu-20.04
44+
45+
- job: MacOSBuild
46+
steps:
47+
- template: passes-mac.yml
48+
pool:
49+
vmImage: macOS-latest
3850

3951
- job: Style
4052
steps:
@@ -43,3 +55,5 @@ jobs:
4355

4456
- script: dotnet tool run fantomas -- --check --recurse .
4557
displayName: Fantomas
58+
pool:
59+
vmImage: windows-latest

build/manifest.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ $artifacts = @{
5656
".\src\QsCompiler\LlvmBindings\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.LlvmBindings.dll",
5757
".\src\QsCompiler\Transformations\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsTransformations.dll",
5858
".\src\QsCompiler\CommandLineTool\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsc.dll",
59+
".\src\QsFmt\App\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsfmt.dll",
5960
".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll",
6061
".\src\QuantumSdk\Tools\DefaultEntryPoint\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.DefaultEntryPoint.Generation.dll"
6162
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };

build/pack.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Publish-One '../src/QsCompiler/CommandLineTool/CommandLineTool.csproj'
8989
Publish-One '../src/QsCompiler/LlvmBindings/LlvmBindings.csproj'
9090
Publish-One '../src/QuantumSdk/Tools/BuildConfiguration/BuildConfiguration.csproj'
9191
Publish-One '../src/QuantumSdk/Tools/DefaultEntryPoint/DefaultEntryPoint.csproj'
92+
Publish-One '../src/QsFmt/App/App.fsproj'
9293

9394
Pack-One '../src/QsCompiler/Compiler/Compiler.csproj' '-IncludeReferencedProjects'
9495
Pack-One '../src/QsCompiler/QirGeneration/QirGeneration.csproj'

build/passes-linux.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
steps:
3+
- script: |
4+
export DEBIAN_FRONTEND=noninteractive
5+
sudo apt-get update -y
6+
sudo apt-get install -y
7+
sudo apt-get remove -y llvm-12
8+
sudo apt-get install -y curl pkg-config findutils wget
9+
sudo apt install -y clang-11 cmake clang-format-11 clang-tidy-11
10+
sudo apt-get install -y llvm-11 lldb-11 llvm-11-dev libllvm11 llvm-11-runtime
11+
sudo apt install -y python3 python3-pip
12+
sudo apt-get remove -y llvm-10
13+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
14+
git submodule update --init --recursive
15+
cd src/Passes/
16+
pip install -r requirements.txt
17+
chmod +x manage
18+
export PYTHONUNBUFFERED=1
19+
export PYTHON_BIN_PATH=/usr/bin/python3
20+
export CC=clang-11
21+
export CXX=clang++-11
22+
./manage runci
23+
24+
displayName: Linux build and CI for passes

build/passes-mac.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
steps:
3+
- script: |
4+
rm '/usr/local/bin/2to3'
5+
brew install llvm@11
6+
brew install cmake
7+
brew install [email protected]
8+
brew unlink [email protected]
9+
10+
11+
# Updating paths
12+
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
13+
export PATH="/usr/local/opt/llvm@11/bin:$PATH"
14+
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/llvm@11/lib"
15+
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/llvm@11/include"
16+
17+
git submodule update --init --recursive
18+
cd src/Passes/
19+
pip3 install --user -r requirements.txt
20+
chmod +x manage
21+
./manage --loglevel info runci
22+

build/steps.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
steps:
2+
23
- pwsh: ./build.ps1
34
displayName: "Build all"
45
workingDirectory: $(System.DefaultWorkingDirectory)/build

0 commit comments

Comments
 (0)