From b9e0f78b4d0728fddfc300e5472848e819c59b24 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Fri, 20 Nov 2020 02:19:51 -0700 Subject: [PATCH 1/4] Setting KV task to v1 (#743) --- .github/workflows/qdk-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qdk-sync.yml b/.github/workflows/qdk-sync.yml index 26b4da3d7d..d95a0ea8f7 100644 --- a/.github/workflows/qdk-sync.yml +++ b/.github/workflows/qdk-sync.yml @@ -15,7 +15,7 @@ jobs: creds: ${{ secrets.AZURE_CREDENTIALS }} - id: AzureKeyVault - uses: Azure/get-keyvault-secrets@v1.0 + uses: Azure/get-keyvault-secrets@v1 with: keyvault: 'kv-qdk-build' secrets: 'qdkBuildPAT' From b12dfd5a3ef51884a36903e15a8b7e5581b8e4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Zaragoza=20Cort=C3=A9s?= Date: Fri, 20 Nov 2020 13:59:11 -0800 Subject: [PATCH 2/4] Create a new DotnetCoreDll property for the current syntax tree resource name (#741) * Create a new DotnetCoreDll property that always provides the name of the resource currently used by the compiler to attach the syntax tree to a DLL. * Fix typo. --- src/QsCompiler/Compiler/CompilationLoader.cs | 2 +- src/QsCompiler/DataStructures/ReservedKeywords.fs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/QsCompiler/Compiler/CompilationLoader.cs b/src/QsCompiler/Compiler/CompilationLoader.cs index e2cf64da97..c7f01ee2ef 100644 --- a/src/QsCompiler/Compiler/CompilationLoader.cs +++ b/src/QsCompiler/Compiler/CompilationLoader.cs @@ -1083,7 +1083,7 @@ bool CanBeIncluded(string dll) using var outputStream = File.OpenWrite(outputPath); serialization.Seek(0, SeekOrigin.Begin); - var astResource = new CodeAnalysis.ResourceDescription(DotnetCoreDll.ResourceNameQsDataBondV1, () => serialization, true); + var astResource = new CodeAnalysis.ResourceDescription(DotnetCoreDll.SyntaxTreeResourceName, () => serialization, true); var result = compilation.Emit( outputStream, options: new CodeAnalysis.Emit.EmitOptions(), diff --git a/src/QsCompiler/DataStructures/ReservedKeywords.fs b/src/QsCompiler/DataStructures/ReservedKeywords.fs index 36e3b4bd36..0e4fab015e 100644 --- a/src/QsCompiler/DataStructures/ReservedKeywords.fs +++ b/src/QsCompiler/DataStructures/ReservedKeywords.fs @@ -278,6 +278,8 @@ module DotnetCoreDll = [] let ResourceName = "__qsharp_data__.bson" let ResourceNameQsDataBondV1 = "__qsharp_data_bond_v1__.bson" + // Should always provide the name of the resource currently used by the compiler to attach the syntax tree to a DLL. + let SyntaxTreeResourceName = ResourceNameQsDataBondV1 let MetadataNamespace = "__qsharp__" let ReferenceAlias = "__qsharp_reference__" let MetadataType = "Metadata" From d2d2b539ede123d6292eec55c4f3e0f9e1228846 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Mon, 23 Nov 2020 10:58:20 -0800 Subject: [PATCH 3/4] Explicitly build language server during pack-extension.ps1 --- build/pack-extensions.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/pack-extensions.ps1 b/build/pack-extensions.ps1 index 90676396e1..f3fb164e35 100644 --- a/build/pack-extensions.ps1 +++ b/build/pack-extensions.ps1 @@ -57,6 +57,14 @@ function Pack-SelfContained() { [string] $PackageData = $null ); + # Make sure the LanguageServer is built on its own: + dotnet build (Join-Path $PSScriptRoot $project) ` + -c $Env:BUILD_CONFIGURATION ` + -v $Env:BUILD_VERBOSITY ` + @args ` + /property:Version=$Env:ASSEMBLY_VERSION ` + /property:InformationalVersion=$Env:SEMVER_VERSION + Write-Host "##[info]Packing $Project as a self-contained deployment..."; $Runtimes.GetEnumerator() | ForEach-Object { $DotNetRuntimeID = $_.Key; From 88debafc7b7bcedc974c1c115998df74a954a1f9 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Mon, 23 Nov 2020 11:48:27 -0800 Subject: [PATCH 4/4] Missing ASSEMBLY_CONSTANTS --- build/pack-extensions.ps1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/pack-extensions.ps1 b/build/pack-extensions.ps1 index f3fb164e35..cfdefa557f 100644 --- a/build/pack-extensions.ps1 +++ b/build/pack-extensions.ps1 @@ -57,6 +57,13 @@ function Pack-SelfContained() { [string] $PackageData = $null ); + Write-Host "##[info]Building $project ($action)..." + if ("" -ne "$Env:ASSEMBLY_CONSTANTS") { + $args = @("/property:DefineConstants=$Env:ASSEMBLY_CONSTANTS"); + } else { + $args = @(); + } + # Make sure the LanguageServer is built on its own: dotnet build (Join-Path $PSScriptRoot $project) ` -c $Env:BUILD_CONFIGURATION ` @@ -75,11 +82,6 @@ function Pack-SelfContained() { New-Item -ItemType Directory -Path $ArchiveDir -Force -ErrorAction SilentlyContinue; try { - if ("" -ne "$Env:ASSEMBLY_CONSTANTS") { - $args = @("/property:DefineConstants=$Env:ASSEMBLY_CONSTANTS"); - } else { - $args = @(); - } $ArchivePath = Join-Path $ArchiveDir "$BaseName-$DotNetRuntimeID-$Env:SEMVER_VERSION.zip"; dotnet publish (Join-Path $PSScriptRoot $Project) ` -c $Env:BUILD_CONFIGURATION `