Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bld/
[Oo]bj/
[Ll]og/
[Dd]rops/
**/qir/qir-gen.ll
**/qir-gen.ll

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
6 changes: 3 additions & 3 deletions build/steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ steps:
- template: steps-init.yml


- powershell: ./build.ps1
- pwsh: ./build.ps1
displayName: "Building Q# runtime"
workingDirectory: $(System.DefaultWorkingDirectory)/build


- powershell: ./test.ps1
- pwsh: ./test.ps1
displayName: "Testing Q# runtime"
workingDirectory: $(System.DefaultWorkingDirectory)/build
condition: and(succeeded(), ne(variables['Skip.Tests'], 'true'))


- powershell: ./pack.ps1
- pwsh: ./pack.ps1
displayName: "Pack Q# runtime (Windows only)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(System.DefaultWorkingDirectory)/build
Expand Down
11 changes: 11 additions & 0 deletions src/QirRuntime/build-qir-runtime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
# Licensed under the MIT License.

if ($Env:ENABLE_QIRRUNTIME -eq "true") {
Write-Host "##[info]Compile Q# Projects into QIR"
$qirStaticPath = Join-Path $PSScriptRoot test QIR-static qsharp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond the scope of this PR, but we may want to consider in the future making this rely on PowerShell cmdlet functions that wrap dotnet build and ensure that arguments such as build configuration and assembly versions are set from environment variables in a uniform way.

dotnet build $qirStaticPath -c $Env:BUILD_CONFIGURATION -v $Env:BUILD_VERBOSITY
if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to compile Q# project at '$qirStaticPath' into QIR."
return
}
Copy-Item -Path (Join-Path $qirStaticPath qir *.ll) -Destination (Split-Path $qirStaticPath -Parent)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we perhaps delete the currently generated QIR files that are in the /src/QirRuntime/test/QIR-static folder to avoid confusion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be good to delete the one file that is now being generated (the second file was manually authored and covers functionality not supported by Q# but present in QIR spec)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does remove that file.

# Also copy to drops so it ends up in build artifacts, for easier post-build debugging.
Copy-Item -Path (Join-Path $qirStaticPath qir *.ll) -Destination $Env:DROPS_DIR

Write-Host "##[info]Build QIR Runtime"
$oldCC = $env:CC
$oldCXX = $env:CXX
Expand Down
Loading