Skip to content

Commit d4db68a

Browse files
committed
Merge branch 'main' into otel
2 parents 01e165b + 7c81ac0 commit d4db68a

36 files changed

+309
-141
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<PropertyGroup>
3+
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
4+
<CachePath>$(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid())</CachePath>
5+
<BaseIntermediateOutputPath>$(CachePath)\obj\</BaseIntermediateOutputPath>
6+
<NUGET_HTTP_CACHE_PATH>$(CachePath)\http_cache</NUGET_HTTP_CACHE_PATH >
7+
<RestorePackagesPath>$(CachePath)\nuget_cache</RestorePackagesPath>
8+
</PropertyGroup>
9+
</Project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<Project>
2+
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="$(MSBuildProjectDirectory)\..\..\eng\Versions.props" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>net7.0</TargetFramework>
7+
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
8+
<CachePath>$(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid())</CachePath>
9+
<OutputPath>$(CachePath)\bin</OutputPath>
10+
<IntermediateOutputPath>$(CachePath)\obj</IntermediateOutputPath>
11+
<NUGET_HTTP_CACHE_PATH>$(CachePath)\http_cache</NUGET_HTTP_CACHE_PATH >
12+
<RestorePackagesPath>$(CachePath)\nuget_cache</RestorePackagesPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<RestoreAdditionalProjectSources>https://api.nuget.org/v3/index.json</RestoreAdditionalProjectSources>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="FSharp.Compiler.Service" Version="[$(FSharpCompilerServicePackageVersion)]" />
21+
</ItemGroup>
22+
23+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="$(MSBuildProjectDirectory)\..\..\eng\Versions.props" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>net7.0</TargetFramework>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<RestoreAdditionalProjectSources>https://api.nuget.org/v3/index.json</RestoreAdditionalProjectSources>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="FSharp.Core" Version="[$(FSCorePackageVersionValue)]" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
</packageSources>
6+
</configuration>

eng/Build.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ param (
6363
[switch]$sourceBuild,
6464
[switch]$skipBuild,
6565
[switch]$compressAllMetadata,
66+
[switch]$verifypackageshipstatus = $false,
6667
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)
6768

6869
Set-StrictMode -version 2.0
@@ -117,6 +118,7 @@ function Print-Usage() {
117118
Write-Host " -sourceBuild Simulate building for source-build."
118119
Write-Host " -skipbuild Skip building product"
119120
Write-Host " -compressAllMetadata Build product with compressed metadata"
121+
Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget"
120122
Write-Host ""
121123
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
122124
}
@@ -149,6 +151,7 @@ function Process-Arguments() {
149151
$script:testFSharpQA = $False
150152
$script:testVs = $False
151153
$script:testpack = $False
154+
$script:verifypackageshipstatus = $True
152155
}
153156

154157
if ($noRestore) {
@@ -175,6 +178,10 @@ function Process-Arguments() {
175178
$script:compressAllMetadata = $True;
176179
}
177180

181+
if ($verifypackageshipstatus) {
182+
$script:verifypackageshipstatus = $True;
183+
}
184+
178185
foreach ($property in $properties) {
179186
if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) {
180187
Write-Host "Invalid argument: $property"
@@ -605,6 +612,39 @@ try {
605612
throw "Error Verifying nupkgs have access to the source code"
606613
}
607614

615+
$verifypackageshipstatusFailed = $false
616+
if ($verifypackageshipstatus) {
617+
$dotnetPath = InitializeDotNetCli
618+
$dotnetExe = Join-Path $dotnetPath "dotnet.exe"
619+
620+
Write-Host "================================================================================================================================"
621+
Write-Host "The error messages below are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published "
622+
Write-Host "================================================================================================================================"
623+
$exitCode = Exec-Process "$dotnetExe" "restore $RepoRoot\buildtools\checkpackages\FSharp.Compiler.Service_notshipped.fsproj"
624+
if ($exitCode -eq 0) {
625+
Write-Host -ForegroundColor Red "Command succeeded but was expected to fail: this means that the fsharp.compiler.service nuget package is already published"
626+
Write-Host -ForegroundColor Red "Modify the version number of FSharp.Compiler.Servoce to be published"
627+
$verifypackageshipstatusFailed = $True
628+
}
629+
630+
$exitCode = Exec-Process "$dotnetExe" "restore $RepoRoot\buildtools\checkpackages\FSharp.Core_notshipped.fsproj"
631+
if ($exitCode -eq 0) {
632+
Write-Host -ForegroundColor Red "Command succeeded but was expected to fail: this means that the fsharp.core nuget package is already published"
633+
Write-Host -ForegroundColor Red "Modify the version number of FSharp.Compiler.Servoce to be published"
634+
$verifypackageshipstatusFailed = $True
635+
}
636+
if (-not $verifypackageshipstatusFailed)
637+
{
638+
Write-Host "================================================================================================================================"
639+
Write-Host "The error messages above are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published "
640+
Write-Host "================================================================================================================================"
641+
}
642+
else
643+
{
644+
throw "Error Verifying shipping status of shipping nupkgs"
645+
}
646+
}
647+
608648
ExitWithExitCode 0
609649
}
610650
catch {

eng/build.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,21 +255,24 @@ function BuildSolution {
255255
rm -fr $bootstrap_dir
256256
fi
257257
if [ ! -f "$bootstrap_dir/fslex.dll" ]; then
258+
local bltools=""
259+
if [[ "$bl" != "" ]]; then
260+
bltools=$bl+".lex.binlog"
261+
fi
258262
BuildMessage="Error building tools"
259-
MSBuild "$repo_root/buildtools/buildtools.proj" \
260-
/restore \
261-
/p:Configuration=$bootstrap_config
263+
MSBuild "$repo_root/buildtools/buildtools.proj" /restore "$bltools" /p:Configuration=$bootstrap_config
262264

263265
mkdir -p "$bootstrap_dir"
264266
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net7.0 $bootstrap_dir/fslex
265267
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net7.0 $bootstrap_dir/fsyacc
266268
fi
267269
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
270+
local bltools=""
271+
if [[ "$bl" != "" ]]; then
272+
bltools=$bl+".bootstrap.binlog"
273+
fi
268274
BuildMessage="Error building bootstrap"
269-
MSBuild "$repo_root/Proto.sln" \
270-
/restore \
271-
/p:Configuration=$bootstrap_config
272-
275+
MSBuild "$repo_root/Proto.sln" /restore "$bltools" /p:Configuration=$bootstrap_config
273276
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net7.0 $bootstrap_dir/fsc
274277
fi
275278
fi

eng/common/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function MSBuild-Core {
490490
}
491491
}
492492

493-
RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci /bl "$@"
493+
RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@"
494494
}
495495

496496
ResolvePath "${BASH_SOURCE[0]}"

src/Compiler/Checking/CheckExpressions.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7019,7 +7019,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
70197019
let newFormatMethod =
70207020
match GetIntrinsicConstructorInfosOfType cenv.infoReader m formatTy |> List.filter (fun minfo -> minfo.NumArgs = [3]) with
70217021
| [ctorInfo] -> ctorInfo
7022-
| _ -> languageFeatureNotSupportedInLibraryError g.langVersion LanguageFeature.StringInterpolation m
7022+
| _ -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m
70237023

70247024
let stringKind =
70257025
// If this is an interpolated string then try to force the result to be a string
@@ -7054,7 +7054,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
70547054

70557055
match createMethodOpt with
70567056
| Some createMethod -> Choice2Of2 createMethod
7057-
| None -> languageFeatureNotSupportedInLibraryError g.langVersion LanguageFeature.StringInterpolation m
7057+
| None -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m
70587058

70597059
// ... or if that fails then may be a PrintfFormat by a type-directed rule....
70607060
elif not (isObjTy g overallTy.Commit) && AddCxTypeMustSubsumeTypeUndoIfFailed env.DisplayEnv cenv.css m overallTy.Commit formatTy then

src/Compiler/Checking/InfoReader.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this =
922922

923923
let checkLanguageFeatureRuntimeAndRecover (infoReader: InfoReader) langFeature m =
924924
if not (infoReader.IsLanguageFeatureRuntimeSupported langFeature) then
925-
let featureStr = infoReader.g.langVersion.GetFeatureString langFeature
925+
let featureStr = LanguageVersion.GetFeatureString langFeature
926926
errorR (Error(FSComp.SR.chkFeatureNotRuntimeSupported featureStr, m))
927927

928928
let GetIntrinsicConstructorInfosOfType (infoReader: InfoReader) m ty =

0 commit comments

Comments
 (0)