Skip to content
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
40 changes: 40 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ stages:
publishLocation: Container
continueOnError: true
condition: eq(variables['_testKind'], 'testFSharpQA')
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents Windows $(_testKind)'
publishLocation: Container
continueOnError: true
condition: always()

# Linux
- job: Linux
Expand All @@ -208,6 +216,14 @@ stages:
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents Linux'
publishLocation: Container
continueOnError: true
condition: always()

# MacOS
- job: MacOS
Expand All @@ -229,6 +245,14 @@ stages:
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents Mac'
publishLocation: Container
continueOnError: true
condition: always()

# Source Build Linux
- job: SourceBuild_Linux
Expand All @@ -239,6 +263,14 @@ stages:
clean: true
- script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true
displayName: Build
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents SourceBuild_Linux'
publishLocation: Container
continueOnError: true
condition: always()

# Source Build Windows
- job: SourceBuild_Windows
Expand All @@ -249,6 +281,14 @@ stages:
clean: true
- script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true
displayName: Build
- task: PublishBuildArtifacts@1
displayName: Publish NuGet cache contents
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
ArtifactName: 'NuGetPackageContents SourceBuild_Windows'
publishLocation: Container
continueOnError: true
condition: always()

# Up-to-date
- job: UpToDate_Windows
Expand Down
18 changes: 18 additions & 0 deletions eng/AfterSolutionBuild.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>

<!-- Used as a diagnostic tool to view the state of the NuGet package cache as it existed immediately after a restore/build. -->

<ItemGroup>
<PackageRootFiles Include="$(NuGetPackageRoot)/**" />
</ItemGroup>

<Target Name="_DumpPackageRootDirectoryListing"
AfterTargets="Build">
<PropertyGroup>
<PackageRootArtifactDirectory>$(ArtifactsDir)NugetPackageRootContents</PackageRootArtifactDirectory>
<PackageRootContentsFile>$(PackageRootArtifactDirectory)/package_contents.txt</PackageRootContentsFile>
</PropertyGroup>
<MakeDir Directories="$(PackageRootArtifactDirectory)" Condition="!Exists('$(PackageRootArtifactDirectory)')" />
<WriteLinesToFile File="$(PackageRootContentsFile)" Lines="@(PackageRootFiles)" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Tasks.Core.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Reflection.Metadata.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Collections.Immutable.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Buffers.dll" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<dependency id="System.Threading.Thread" version="4.0.0" />
<dependency id="System.Threading.ThreadPool" version="4.0.10" />
<dependency id="System.ValueTuple" version="4.3.0" />
<dependency id="System.Buffers" version="4.5.0" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<dependency id="System.Threading.Thread" version="4.3.0" />
<dependency id="System.Threading.ThreadPool" version="4.3.0" />
<dependency id="System.ValueTuple" version="4.4.0" />
<dependency id="System.Buffers" version="4.5.0" />
</group>
</dependencies>
<contentFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module Utilities =
| None -> ""

let arguments prefix =
sprintf "%s -restore %s %c%s%c /t:FSI-PackageManagement" prefix binLoggingArguments '\"' projectPath '\"'
sprintf "%s -restore %s %c%s%c /t:InteractivePackageManagement" prefix binLoggingArguments '\"' projectPath '\"'

let workingDir = Path.GetDirectoryName projectPath

Expand All @@ -230,6 +230,10 @@ namespace lib"
<PropertyGroup>
<TargetFramework>$(TARGETFRAMEWORK)</TargetFramework>
<IsPackable>false</IsPackable>

<!-- Temporary fix some sdks, shipped internally with broken parameterization -->
<FSharpCoreImplicitPackageVersion Condition=""'$(FSharpCoreImplicitPackageVersion)' == '{{FSharpCoreShippedPackageVersion}}'"">4.7.0</FSharpCoreImplicitPackageVersion>
<FSharpCoreImplicitPackageVersion Condition=""'$(FSharpCoreImplicitPackageVersion)' == '{{FSharpCorePreviewPackageVersion}}'"">4.7.1-*</FSharpCoreImplicitPackageVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include='Library.fs' />
Expand Down Expand Up @@ -273,15 +277,31 @@ $(PACKAGEREFERENCES)
</ItemGroup>
</Target>

<Target Name='ComputePackageRoots'
BeforeTargets='CoreCompile;FSI-PackageManagement'
<Target Name='ComputePackageRootsForInteractivePackageManagement'
BeforeTargets='CoreCompile'
DependsOnTargets='CollectPackageReferences'>
<ItemGroup>
<FsxResolvedFile Include='@(ResolvedCompileFileDefinitions)'>
<PackageRootProperty>Pkg$([System.String]::Copy('%(ResolvedCompileFileDefinitions.NugetPackageId)').Replace('.','_'))</PackageRootProperty>
<PackageRoot>$([MSBuild]::EnsureTrailingSlash('$(%(FsxResolvedFile.PackageRootProperty))'))</PackageRoot>
<InitializeSourcePath>$(%(FsxResolvedFile.PackageRootProperty))\content\%(ResolvedCompileFileDefinitions.FileName)%(ResolvedCompileFileDefinitions.Extension).fsx</InitializeSourcePath>
</FsxResolvedFile>
<InteractiveResolvedFile Remove='@(InteractiveResolvedFile)' />
<InteractiveResolvedFile Include='@(ResolvedCompileFileDefinitions->ClearMetadata())' KeepDuplicates='false'>
<NormalizedIdentity Condition=""'%(Identity)'!=''"">$([System.String]::Copy('%(Identity)').Replace('\', '/'))</NormalizedIdentity>
<NormalizedPathInPackage Condition=""'%(ResolvedCompileFileDefinitions.PathInPackage)'!=''"">$([System.String]::Copy('%(ResolvedCompileFileDefinitions.PathInPackage)').Replace('\', '/'))</NormalizedPathInPackage>
<PositionPathInPackage Condition=""'%(InteractiveResolvedFile.NormalizedPathInPackage)'!=''"">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').IndexOf('%(InteractiveResolvedFile.NormalizedPathInPackage)'))</PositionPathInPackage>
<PackageRoot Condition=""'%(InteractiveResolvedFile.NormalizedPathInPackage)'!='' and '%(InteractiveResolvedFile.PositionPathInPackage)'!='-1'"">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').Substring(0, %(InteractiveResolvedFile.PositionPathInPackage)))</PackageRoot>
<InitializeSourcePath>%(InteractiveResolvedFile.PackageRoot)content\%(ResolvedCompileFileDefinitions.FileName)%(ResolvedCompileFileDefinitions.Extension).fsx</InitializeSourcePath>
<IsNotImplementationReference>$([System.String]::Copy('%(ResolvedCompileFileDefinitions.PathInPackage)').StartsWith('ref/'))</IsNotImplementationReference>
<NuGetPackageId>%(ResolvedCompileFileDefinitions.NuGetPackageId)</NuGetPackageId>
<NuGetPackageVersion>%(ResolvedCompileFileDefinitions.NuGetPackageVersion)</NuGetPackageVersion>
</InteractiveResolvedFile>
<InteractiveResolvedFile Include='@(RuntimeCopyLocalItems->ClearMetadata())' KeepDuplicates='false' >
<NormalizedIdentity Condition=""'%(Identity)'!=''"">$([System.String]::Copy('%(Identity)').Replace('\', '/'))</NormalizedIdentity>
<NormalizedPathInPackage Condition=""'%(RuntimeCopyLocalItems.PathInPackage)'!=''"">$([System.String]::Copy('%(RuntimeCopyLocalItems.PathInPackage)').Replace('\', '/'))</NormalizedPathInPackage>
<PositionPathInPackage Condition=""'%(InteractiveResolvedFile.NormalizedPathInPackage)'!=''"">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').IndexOf('%(InteractiveResolvedFile.NormalizedPathInPackage)'))</PositionPathInPackage>
<PackageRoot Condition=""'%(InteractiveResolvedFile.NormalizedPathInPackage)'!='' and '%(InteractiveResolvedFile.PositionPathInPackage)'!='-1'"">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').Substring(0, %(InteractiveResolvedFile.PositionPathInPackage)))</PackageRoot>
<InitializeSourcePath>%(InteractiveResolvedFile.PackageRoot)content\%(RuntimeCopyLocalItems.FileName)%(RuntimeCopyLocalItems.Extension).fsx</InitializeSourcePath>
<IsNotImplementationReference>$([System.String]::Copy('%(RuntimeCopyLocalItems.PathInPackage)').StartsWith('ref/'))</IsNotImplementationReference>
<NuGetPackageId>%(RuntimeCopyLocalItems.NuGetPackageId)</NuGetPackageId>
<NuGetPackageVersion>%(RuntimeCopyLocalItems.NuGetPackageVersion)</NuGetPackageVersion>
</InteractiveResolvedFile>
<NativeIncludeRoots
Include='@(RuntimeTargetsCopyLocalItems)'
Condition=""'%(RuntimeTargetsCopyLocalItems.AssetType)' == 'native'"">
Expand All @@ -290,7 +310,7 @@ $(PACKAGEREFERENCES)
</ItemGroup>
</Target>

<Target Name='FSI-PackageManagement' DependsOnTargets='ResolvePackageAssets'>
<Target Name='InteractivePackageManagement' DependsOnTargets='ResolvePackageAssets;ComputePackageRootsForInteractivePackageManagement'>
<ItemGroup>
<ReferenceLines Remove='@(ReferenceLines)' />
<ReferenceLines Include='// Generated from #r ""nuget:Package References""' />
Expand All @@ -300,12 +320,18 @@ $(PACKAGEREFERENCES)
<ReferenceLines Include='// MSBuildSDKsPath:($(MSBuildSDKsPath))' />
<ReferenceLines Include='// MSBuildExtensionsPath:($(MSBuildExtensionsPath))' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#r @""%(FsxResolvedFile.HintPath)""' Condition = ""'%(FsxResolvedFile.NugetPackageId)' != '' and '%(FsxResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(FsxResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(FsxResolvedFile.NugetPackageId)' != 'System.ValueTuple' and Exists('%(FsxResolvedFile.HintPath)')"" KeepDuplicates='false' />
<ReferenceLines Include='// References' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#r @""%(InteractiveResolvedFile.FullPath)""' Condition = ""'%(InteractiveResolvedFile.NugetPackageId)' != '' and '%(InteractiveResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(InteractiveResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(InteractiveResolvedFile.NugetPackageId)' != 'System.ValueTuple' and '%(InteractiveResolvedFile.IsNotImplementationReference)' != 'true' and Exists('%(InteractiveResolvedFile.FullPath)')"" KeepDuplicates='false' />
<ReferenceLines Include='//' />
<ReferenceLines Include='// Includes' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#I @""%(InteractiveResolvedFile.PackageRoot)""' Condition= ""'%(InteractiveResolvedFile.NugetPackageId)' != '' and '%(InteractiveResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(InteractiveResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(InteractiveResolvedFile.NugetPackageId)' != 'System.ValueTuple' and $([System.String]::Copy('%(InteractiveResolvedFile.PackageRoot)').EndsWith('/')) and Exists(%(InteractiveResolvedFile.PackageRoot))"" KeepDuplicates='false' />
<ReferenceLines Include='#I @""%(NativeIncludeRoots.Path)""' Condition= ""'%(InteractiveResolvedFile.NugetPackageId)' != '' and '%(InteractiveResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(InteractiveResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(InteractiveResolvedFile.NugetPackageId)' != 'System.ValueTuple' and '%(NativeIncludeRoots.Path)' != ''"" KeepDuplicates='false' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#I @""%(FsxResolvedFile.PackageRoot)""' Condition= ""'%(FsxResolvedFile.PackageRoot)' != ''"" KeepDuplicates='false' />
<ReferenceLines Include='#I @""%(NativeIncludeRoots.Path)""' Condition= ""'%(NativeIncludeRoots.Path)' != ''"" KeepDuplicates='false' />
<ReferenceLines Include='// Load Sources' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#load @""%(FsxResolvedFile.InitializeSourcePath)""' Condition = ""'%(FsxResolvedFile.InitializeSourcePath)' != '' and '%(FsxResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(FsxResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(FsxResolvedFile.NugetPackageId)' != 'System.ValueTuple' and Exists('%(FsxResolvedFile.InitializeSourcePath)')"" KeepDuplicates='false' />
<ReferenceLines Include='#load @""%(InteractiveResolvedFile.InitializeSourcePath)""' Condition = ""'%(InteractiveResolvedFile.InitializeSourcePath)' != '' and '%(InteractiveResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(InteractiveResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(InteractiveResolvedFile.NugetPackageId)' != 'System.ValueTuple' and Exists('%(InteractiveResolvedFile.InitializeSourcePath)')"" KeepDuplicates='false' />
</ItemGroup>

<WriteLinesToFile Lines='@(ReferenceLines)' File='$(MSBuildProjectFullPath).fsx' Overwrite='True' WriteOnlyWhenDifferent='True' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,25 @@ printfn ""%A"" result
Assert.AreEqual(123, value.ReflectionValue :?> int32)
#endif

[<Test>]
member __.``ML - use assembly with ref dependencies``() =
let code = @"
#r ""nuget:Microsoft.ML.OnnxTransformer,1.4.0""

open System
open System.Numerics.Tensors
let inputValues = [| 12.0; 10.0; 17.0; 5.0 |]
let tInput = new DenseTensor<float>(inputValues.AsMemory(), new ReadOnlySpan<int>([|4|]))
tInput.Length
"
use script = new FSharpScript(additionalArgs=[|"/langversion:preview"|])
let mutable assemblyRefCount = 0;
Event.add (fun _ -> assemblyRefCount <- assemblyRefCount + 1) script.AssemblyReferenceAdded
let opt = script.Eval(code) |> getValue
let value = opt.Value
Assert.AreEqual(4L, value.ReflectionValue :?> int64)


[<Test>]
member __.``Simple pinvoke should not be impacted by native resolver``() =
let code = @"
Expand Down
1 change: 1 addition & 0 deletions vsintegration/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" PrivateAssets="all" ExcludeAssets="contentFiles;analyzers;native" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" PrivateAssets="all" ExcludeAssets="contentFiles;analyzers;native" />
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" PrivateAssets="all" ExcludeAssets="contentFiles;analyzers;native" />
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" PrivateAssets="all" ExcludeAssets="contentFiles;analyzers;native" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,6 @@ CONSIDER: get this from CodeDom</comment>
<data name="RSE_GraphicSizeFormat" xml:space="preserve">
<value>{0} x {1}</value>
<comment>Format string for showing a graphic's size

# {0} = width (as an integer)
# {1} = height (as an integer)
#Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456"</comment>
Expand Down