From 81d747250a48afd58f9a865fa777f02251ea21da Mon Sep 17 00:00:00 2001 From: Sarah Marshall Date: Thu, 18 Jun 2020 17:59:07 +0000 Subject: [PATCH 1/5] Build 0.11.2006.1807. --- images/iqsharp-base/Dockerfile | 2 +- src/Core/Core.csproj | 6 +++--- src/Tool/appsettings.json | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/images/iqsharp-base/Dockerfile b/images/iqsharp-base/Dockerfile index eadbf75082..eec6c03397 100644 --- a/images/iqsharp-base/Dockerfile +++ b/images/iqsharp-base/Dockerfile @@ -109,7 +109,7 @@ ENV PATH=$PATH:${HOME}/dotnet:${HOME}/.dotnet/tools \ # Install IQ# and the project templates, using the NuGet packages from the # build context. ARG IQSHARP_VERSION -RUN dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.10.2001.525-beta" && \ +RUN dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.11.2006.1807-beta" && \ dotnet tool install \ --global \ Microsoft.Quantum.IQSharp \ diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 036b02f2ca..2471eeab27 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -34,9 +34,9 @@ - - - + + + diff --git a/src/Tool/appsettings.json b/src/Tool/appsettings.json index 7eeb65f8a6..43a49dab77 100644 --- a/src/Tool/appsettings.json +++ b/src/Tool/appsettings.json @@ -6,21 +6,21 @@ }, "AllowedHosts": "*", "DefaultPackageVersions": [ - "Microsoft.Quantum.Compiler::0.11.2006.403", + "Microsoft.Quantum.Compiler::0.11.2006.1807-beta", - "Microsoft.Quantum.CsharpGeneration::0.11.2006.403", - "Microsoft.Quantum.Development.Kit::0.11.2006.403", - "Microsoft.Quantum.Simulators::0.11.2006.403", - "Microsoft.Quantum.Xunit::0.11.2006.403", + "Microsoft.Quantum.CsharpGeneration::0.11.2006.1807-beta", + "Microsoft.Quantum.Development.Kit::0.11.2006.1807-beta", + "Microsoft.Quantum.Simulators::0.11.2006.1807-beta", + "Microsoft.Quantum.Xunit::0.11.2006.1807-beta", - "Microsoft.Quantum.Standard::0.11.2006.403", - "Microsoft.Quantum.Chemistry::0.11.2006.403", - "Microsoft.Quantum.Chemistry.Jupyter::0.11.2006.403", - "Microsoft.Quantum.MachineLearning::0.11.2006.403", - "Microsoft.Quantum.Numerics::0.11.2006.403", + "Microsoft.Quantum.Standard::0.11.2006.1807-beta", + "Microsoft.Quantum.Chemistry::0.11.2006.1807-beta", + "Microsoft.Quantum.Chemistry.Jupyter::0.11.2006.1807-beta", + "Microsoft.Quantum.MachineLearning::0.11.2006.1807-beta", + "Microsoft.Quantum.Numerics::0.11.2006.1807-beta", "Microsoft.Quantum.Katas::0.11.2006.403", - "Microsoft.Quantum.Research::0.11.2006.403" + "Microsoft.Quantum.Research::0.11.2006.1807-beta" ] } From 8f1f0ea6036c33ccbfee5e5777b352265f77697c Mon Sep 17 00:00:00 2001 From: Sarah Marshall Date: Fri, 19 Jun 2020 12:12:20 -0700 Subject: [PATCH 2/5] Use Uri.LocalPath instead of Uri.AbsolutePath --- src/Core/Compiler/CompilerService.cs | 2 +- src/Core/Snippets/Snippets.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Compiler/CompilerService.cs b/src/Core/Compiler/CompilerService.cs index 2869592270..5a2e9dbabb 100644 --- a/src/Core/Compiler/CompilerService.cs +++ b/src/Core/Compiler/CompilerService.cs @@ -104,7 +104,7 @@ private AssemblyInfo BuildAssembly(ImmutableDictionary sources, Com { // Generate C# simulation code from Q# syntax tree and convert it into C# syntax trees: var trees = new List(); - NonNullable GetFileId(Uri uri) => CompilationUnitManager.TryGetFileId(uri, out var id) ? id : NonNullable.New(uri.AbsolutePath); + NonNullable GetFileId(Uri uri) => CompilationUnitManager.TryGetFileId(uri, out var id) ? id : NonNullable.New(uri.LocalPath); foreach (var file in sources.Keys) { var sourceFile = GetFileId(file); diff --git a/src/Core/Snippets/Snippets.cs b/src/Core/Snippets/Snippets.cs index bf3f0cf189..f7fbdac499 100644 --- a/src/Core/Snippets/Snippets.cs +++ b/src/Core/Snippets/Snippets.cs @@ -166,10 +166,10 @@ Snippet populate(Snippet s) => { id = string.IsNullOrWhiteSpace(s.id) ? Guid.NewGuid().ToString() : s.id, code = s.code, - warnings = logger.Logs.Where(m => m.Source == s.Uri.AbsolutePath).Select(logger.Format).ToArray(), + warnings = logger.Logs.Where(m => m.Source == s.Uri.LocalPath).Select(logger.Format).ToArray(), Elements = assembly?.SyntaxTree? .SelectMany(ns => ns.Elements) - .Where(c => c.SourceFile() == s.Uri.AbsolutePath) + .Where(c => c.SourceFile() == s.Uri.LocalPath) .ToArray() }; From d7d757875deae70762b4cde5fa9c8b3ddfdded66 Mon Sep 17 00:00:00 2001 From: Sarah Marshall Date: Mon, 22 Jun 2020 13:00:40 -0700 Subject: [PATCH 3/5] Use CompilationUnitManager.GetFileId --- src/Core/Compiler/CompilerService.cs | 3 +-- src/Core/Core.csproj | 2 +- src/Core/Snippets/Snippets.cs | 8 ++++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Core/Compiler/CompilerService.cs b/src/Core/Compiler/CompilerService.cs index 5a2e9dbabb..0984bbf854 100644 --- a/src/Core/Compiler/CompilerService.cs +++ b/src/Core/Compiler/CompilerService.cs @@ -104,10 +104,9 @@ private AssemblyInfo BuildAssembly(ImmutableDictionary sources, Com { // Generate C# simulation code from Q# syntax tree and convert it into C# syntax trees: var trees = new List(); - NonNullable GetFileId(Uri uri) => CompilationUnitManager.TryGetFileId(uri, out var id) ? id : NonNullable.New(uri.LocalPath); foreach (var file in sources.Keys) { - var sourceFile = GetFileId(file); + var sourceFile = CompilationUnitManager.GetFileId(file); var code = SimulationCode.generate(sourceFile, CodegenContext.Create(qsCompilation.Namespaces)); var tree = CSharpSyntaxTree.ParseText(code, encoding: UTF8Encoding.UTF8); trees.Add(tree); diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 2471eeab27..3270e3a728 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -34,7 +34,7 @@ - + diff --git a/src/Core/Snippets/Snippets.cs b/src/Core/Snippets/Snippets.cs index f7fbdac499..5c57ed12c9 100644 --- a/src/Core/Snippets/Snippets.cs +++ b/src/Core/Snippets/Snippets.cs @@ -10,6 +10,7 @@ using System.Runtime.Loader; using Microsoft.Extensions.Logging; using Microsoft.Quantum.IQSharp.Common; +using Microsoft.Quantum.QsCompiler.CompilationBuilder; namespace Microsoft.Quantum.IQSharp { @@ -166,10 +167,13 @@ Snippet populate(Snippet s) => { id = string.IsNullOrWhiteSpace(s.id) ? Guid.NewGuid().ToString() : s.id, code = s.code, - warnings = logger.Logs.Where(m => m.Source == s.Uri.LocalPath).Select(logger.Format).ToArray(), + warnings = logger.Logs + .Where(m => m.Source == CompilationUnitManager.GetFileId(s.Uri).Value) + .Select(logger.Format) + .ToArray(), Elements = assembly?.SyntaxTree? .SelectMany(ns => ns.Elements) - .Where(c => c.SourceFile() == s.Uri.LocalPath) + .Where(c => c.SourceFile() == CompilationUnitManager.GetFileId(s.Uri).Value) .ToArray() }; From 687877dcf32876756e44abbf4971b5e065d075d8 Mon Sep 17 00:00:00 2001 From: Sarah Marshall Date: Mon, 22 Jun 2020 20:03:48 +0000 Subject: [PATCH 4/5] Build 0.11.2006.2203. --- images/iqsharp-base/Dockerfile | 2 +- src/Core/Core.csproj | 6 +++--- src/Tool/appsettings.json | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/images/iqsharp-base/Dockerfile b/images/iqsharp-base/Dockerfile index eec6c03397..a633eb5572 100644 --- a/images/iqsharp-base/Dockerfile +++ b/images/iqsharp-base/Dockerfile @@ -109,7 +109,7 @@ ENV PATH=$PATH:${HOME}/dotnet:${HOME}/.dotnet/tools \ # Install IQ# and the project templates, using the NuGet packages from the # build context. ARG IQSHARP_VERSION -RUN dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.11.2006.1807-beta" && \ +RUN dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.11.2006.2203-beta" && \ dotnet tool install \ --global \ Microsoft.Quantum.IQSharp \ diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 3270e3a728..28f869764f 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -34,9 +34,9 @@ - - - + + + diff --git a/src/Tool/appsettings.json b/src/Tool/appsettings.json index 43a49dab77..da954f0fd0 100644 --- a/src/Tool/appsettings.json +++ b/src/Tool/appsettings.json @@ -6,21 +6,21 @@ }, "AllowedHosts": "*", "DefaultPackageVersions": [ - "Microsoft.Quantum.Compiler::0.11.2006.1807-beta", + "Microsoft.Quantum.Compiler::0.11.2006.2203-beta", - "Microsoft.Quantum.CsharpGeneration::0.11.2006.1807-beta", - "Microsoft.Quantum.Development.Kit::0.11.2006.1807-beta", - "Microsoft.Quantum.Simulators::0.11.2006.1807-beta", - "Microsoft.Quantum.Xunit::0.11.2006.1807-beta", + "Microsoft.Quantum.CsharpGeneration::0.11.2006.2203-beta", + "Microsoft.Quantum.Development.Kit::0.11.2006.2203-beta", + "Microsoft.Quantum.Simulators::0.11.2006.2203-beta", + "Microsoft.Quantum.Xunit::0.11.2006.2203-beta", - "Microsoft.Quantum.Standard::0.11.2006.1807-beta", - "Microsoft.Quantum.Chemistry::0.11.2006.1807-beta", - "Microsoft.Quantum.Chemistry.Jupyter::0.11.2006.1807-beta", - "Microsoft.Quantum.MachineLearning::0.11.2006.1807-beta", - "Microsoft.Quantum.Numerics::0.11.2006.1807-beta", + "Microsoft.Quantum.Standard::0.11.2006.2203-beta", + "Microsoft.Quantum.Chemistry::0.11.2006.2203-beta", + "Microsoft.Quantum.Chemistry.Jupyter::0.11.2006.2203-beta", + "Microsoft.Quantum.MachineLearning::0.11.2006.2203-beta", + "Microsoft.Quantum.Numerics::0.11.2006.2203-beta", "Microsoft.Quantum.Katas::0.11.2006.403", - "Microsoft.Quantum.Research::0.11.2006.1807-beta" + "Microsoft.Quantum.Research::0.11.2006.2203-beta" ] } From 384602d11c7e4ee53a3fdcc2f0e094b4af57617c Mon Sep 17 00:00:00 2001 From: Sarah Marshall <33814365+samarsha@users.noreply.github.com> Date: Thu, 25 Jun 2020 10:15:03 -0700 Subject: [PATCH 5/5] Comma --- src/Tool/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tool/appsettings.json b/src/Tool/appsettings.json index 4448d43e87..bd8f92a54d 100644 --- a/src/Tool/appsettings.json +++ b/src/Tool/appsettings.json @@ -21,7 +21,7 @@ "Microsoft.Quantum.Katas::0.11.2006.2203-beta", - "Microsoft.Quantum.Research::0.11.2006.2203-beta" + "Microsoft.Quantum.Research::0.11.2006.2203-beta", "Microsoft.Quantum.Providers.IonQ::0.11.2006.2203-beta", "Microsoft.Quantum.Providers.Honeywell::0.11.2006.2203-beta",