Skip to content

Commit

Permalink
Real accessibility (#15484)
Browse files Browse the repository at this point in the history
* merge

* remove unused binding

* temp

* temp

* temp

* temp

* temp

* temp

* fantomas

* temp

* temp

* quotes

* temp

* realsig build and test

* tuples, staticint tests

* SerializableAttribute tests

* SeqExpressionStepping

* AsyncExpressionStepping

* misc

* AttributeTargets

* CCtorDUWithMember ListExpressionStepping

* temp

* cleanup

* fantomas

* temp

* temp

* temp

* Automated command ran: fantomas

  Co-authored-by: KevinRansom <5175830+KevinRansom@users.noreply.github.com>

* Some cleanup

* clean

* fantoms

* temp

* merge issues

* fantomas

* temp

* Update src/Compiler/TypedTree/TypedTreeBasics.fs

Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>

* Update src/Compiler/Optimize/Optimizer.fs

Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>

* inline

* Fix plain build.

* Update changelog

* Fixed release notes

* feedback

* remove surplus realsigs

* Update src/Compiler/TypedTree/TypedTree.fsi

Co-authored-by: Petr Pokorny <petr@innit.cz>

* Update tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs

Co-authored-by: Petr Pokorny <petr@innit.cz>

* baselines

* baselines

* baselines

* build.sh

* restore quotes

* moar quotes

* mutable police

* fantomas

* t

* Update baselines

* Shadowing/LinqCount.fsx baseline

* Shadowing lingcount

* access.fsx

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tomas Grosup <tomasgrosup@microsoft.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: Petr Pokorny <petr@innit.cz>
  • Loading branch information
5 people authored Mar 1, 2024
1 parent f29ce0a commit 68a7dae
Show file tree
Hide file tree
Showing 645 changed files with 185,057 additions and 9,204 deletions.
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<FSharpNetCoreProductDefaultTargetFramework>net8.0</FSharpNetCoreProductDefaultTargetFramework>
</PropertyGroup>

<!--
When developers load the FSharp.Compiler.Service solution we set FSHARPCORE_USE_PACKAGE to true if it hasn't already been set to a value.
This option ensures that building and testing uses the specified FSharp.Core nuget package instead of the local FSharp.Core project.
Expand All @@ -20,6 +21,19 @@
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'false' and '$(DotnetProjInfo)' == 'true'">
<BUILDING_USING_DOTNET>true</BUILDING_USING_DOTNET>
</PropertyGroup>

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' != 'true'">
<!--
When shipping Build fsharp.compiler.service dll using realsig visibility
When testing we have a test pass built using old style visibility to improve
testing coverage.
Don't use it explicitly when building with plain .NET (without Proto or Arcade).
-->
<OtherFlags Condition="'$(Configuration)' != 'Proto' and '$(TestingLegacyInternalSignature)' != 'true'">$(OtherFlags) --realsig-</OtherFlags>
<OtherFlags Condition="'$(Configuration)' != 'Proto' and '$(TestingLegacyInternalSignature)' == 'true'">$(OtherFlags) --realsig+</OtherFlags>

</PropertyGroup>

<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition="Exists('$(RepoRoot)/Directory.Build.props.user')" />

Expand Down
2 changes: 1 addition & 1 deletion FSharp.Compiler.Service.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=mtype/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mubinds/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=munge/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mustinline/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=shouldinline/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mutables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mval/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mvid/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<!-- use this to enable good debugging in the Proto bootstrap compiler -->
<!-- You'll have to remove it to get the actual compiler bo build because optimization is needed for some large methods -->
<!--
<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<Tailcalls>true</Tailcalls>
Expand Down
56 changes: 56 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,62 @@ stages:
ArtifactType: Container
parallel: true

- job: WindowsNoRealsig_testCoreclr
pool:
# The PR build definition sets this variable:
# WindowsMachineQueueName=Windows.vs2022.amd64.open
# and there is an alternate build definition that sets this to a queue that is always scouting the
# next preview of Visual Studio.
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals $(WindowsMachineQueueName)
timeoutInMinutes: 120
steps:
- checkout: self
clean: true

- script: eng\CIBuild.cmd -compressallmetadata -norealsig -testCoreclr -configuration Release
env:
NativeToolsOnMachine: true
displayName: Build

- task: PublishBuildArtifacts@1
displayName: Publish Build BinLog
condition: always()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog'
ArtifactName: 'Windows Release build binlogs'
ArtifactType: Container
parallel: true

- job: WindowsNoRealsig_testDesktop
pool:
# The PR build definition sets this variable:
# WindowsMachineQueueName=Windows.vs2022.amd64.open
# and there is an alternate build definition that sets this to a queue that is always scouting the
# next preview of Visual Studio.
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals $(WindowsMachineQueueName)
timeoutInMinutes: 120
steps:
- checkout: self
clean: true

- script: eng\CIBuild.cmd -compressallmetadata -norealsig -testDesktop -configuration Release
env:
NativeToolsOnMachine: true
displayName: Build

- task: PublishBuildArtifacts@1
displayName: Publish Build BinLog
condition: always()
continueOnError: true
inputs:
PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog'
ArtifactName: 'Windows Release build binlogs'
ArtifactType: Container
parallel: true

- job: WindowsStrictIndentation
pool:
# The PR build definition sets this variable:
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Parser recovers on complex primary constructor patterns, better tree representation for primary constructor patterns. ([PR #16425](https://github.com/dotnet/fsharp/pull/16425))
* Name resolution: keep type vars in subsequent checks ([PR #16456](https://github.com/dotnet/fsharp/pull/16456))
* Higher-order-function-based API for working with the untyped abstract syntax tree. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462))
* Add switch to generate types and members with IL visibility that accurately represents their F# visibility. ([PR #15484](https://github.com/dotnet/fsharp/pull/15484)
* Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473))
* Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470))

Expand Down
7 changes: 5 additions & 2 deletions docs/release-notes/.FSharp.Core/8.0.300.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Fixed
### Added

* Minor tweaks to inline specifications to support Visibility PR ([PR #15484](https://github.com/dotnet/fsharp/pull/15484), [#PR 16427](https://github.com/dotnet/fsharp/pull/15484)

* Preserve original stack traces in resumable state machines generated code if available. ([PR #16568](https://github.com/dotnet/fsharp/pull/16568))
### Fixed
* Preserve original stack traces in resumable state machines generated code if available. ([PR #16568](https://github.com/dotnet/fsharp/pull/16568))
11 changes: 10 additions & 1 deletion eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ param (
[switch]$sourceBuild,
[switch]$skipBuild,
[switch]$compressAllMetadata,
[switch]$norealsig,
[switch]$verifypackageshipstatus = $false,
[parameter(ValueFromRemainingArguments = $true)][string[]]$properties)

Expand Down Expand Up @@ -131,7 +132,8 @@ function Print-Usage() {
Write-Host " -sourceBuild Simulate building for source-build."
Write-Host " -skipbuild Skip building product"
Write-Host " -compressAllMetadata Build product with compressed metadata"
Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget"
Write-Host " -norealsig Build product with realsig- (default use realsig+)"
Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget"
Write-Host ""
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
}
Expand Down Expand Up @@ -210,6 +212,12 @@ function Process-Arguments() {
$script:compressAllMetadata = $True;
}

if ($norealsig) {
$script:realsig = $False;
}
else {
$script:realsig = $True;
}
if ($verifypackageshipstatus) {
$script:verifypackageshipstatus = $True;
}
Expand Down Expand Up @@ -288,6 +296,7 @@ function BuildSolution([string] $solutionName, $nopack) {
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:DotNetBuildFromSource=$sourceBuild `
/p:CompressAllMetadata=$CompressAllMetadata `
/p:TestingLegacyInternalSignature=$realsig `
/v:$verbosity `
$suppressExtensionDeployment `
@properties
Expand Down
6 changes: 6 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ usage()
echo " --skipBuild Do not run the build"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
echo " --sourceBuild Simulate building for source-build"
echo " --norealsig Build product with realsig- (default use realsig+)"
echo " --tfm Override the default target framework"
echo ""
echo "Command line arguments starting with '/p:' are passed through to MSBuild."
Expand Down Expand Up @@ -68,6 +69,7 @@ skip_analyzers=false
skip_build=false
prepare_machine=false
source_build=false
realsig=true
properties=""

docker=false
Expand Down Expand Up @@ -152,6 +154,9 @@ while [[ $# > 0 ]]; do
--sourcebuild)
source_build=true
;;
--norealsig)
realsig=false
;;
--tfm)
tfm=$2
shift
Expand Down Expand Up @@ -308,6 +313,7 @@ function BuildSolution {
/p:QuietRestore=$quiet_restore \
/p:QuietRestoreBinaryLog="$binary_log" \
/p:ArcadeBuildFromSource=$source_build \
/p:TestingLegacyInternalSignature=$realsig \
$properties
fi
}
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Checking/CheckComputationExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol
addVarsToVarSpace varSpace (fun mQueryOp env ->
// Normalize the bindings before detecting the bound variables
match (List.map (BindingNormalization.NormalizeBinding ValOrMemberBinding cenv env) binds) with
| [ NormalizedBinding(kind = SynBindingKind.Normal; mustInline = false; isMutable = false; pat = pat) ] ->
| [ NormalizedBinding(kind = SynBindingKind.Normal; shouldInline = false; isMutable = false; pat = pat) ] ->
// successful case
use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink

Expand Down
Loading

0 comments on commit 68a7dae

Please sign in to comment.