Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use proto build on mac and linux #6380

Merged
merged 29 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f4bd221
use proto on mac and linux
dsyme Mar 29, 2019
8a4baf3
reduce diff
dsyme Mar 30, 2019
0474a23
reduce diff
dsyme Mar 30, 2019
b96120e
reduce diff
dsyme Mar 30, 2019
cf9147b
reduce diff
dsyme Mar 30, 2019
286c336
reduce diff
dsyme Mar 30, 2019
7a6448e
reduce diff
dsyme Mar 30, 2019
965d3b1
Merge branch 'master' of https://github.com/Microsoft/visualfsharp in…
dsyme Apr 2, 2019
978414c
Merge branch 'master' into proto
KevinRansom Apr 8, 2019
95d94de
integrate master
dsyme Apr 14, 2019
a15ef59
integrate master
dsyme Apr 14, 2019
aed6752
fix build
dsyme Apr 14, 2019
bb78e5f
fix build
dsyme Apr 14, 2019
b88d23c
Merge branch 'fix77' into proto
dsyme Apr 14, 2019
1aa6a41
load right FSHarp.Build
dsyme Apr 15, 2019
058bdc9
publish proto apps
dsyme Apr 15, 2019
688850f
revert test env changes
dsyme Apr 15, 2019
c2c7213
revert testing changes
dsyme Apr 16, 2019
fdcf82a
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Apr 16, 2019
e46dcd5
don't repeat bootstrap
dsyme Apr 16, 2019
75e9cc3
be systematic about verbosity
dsyme Apr 17, 2019
d0f51d7
Merge branch 'proto' of https://github.com/dsyme/visualfsharp into proto
dsyme Apr 17, 2019
63c64ef
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Apr 18, 2019
8f09004
remove verbosity flags
dsyme Apr 24, 2019
5833f0c
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme May 31, 2019
d12a626
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Jun 3, 2019
1632239
try align with fsc.fsproj
dsyme Jun 3, 2019
a8eb9b1
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme Jun 4, 2019
52e0844
try to fix build
dsyme Jun 4, 2019
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
3 changes: 0 additions & 3 deletions FSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Interactive.Settings", "src\fsharp\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj", "{649FA588-F02E-457C-9FCF-87E46407481E}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsi", "src\fsharp\fsi\fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}"
ProjectSection(ProjectDependencies) = postProject
{649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E}
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}"
EndProject
Expand Down
11 changes: 5 additions & 6 deletions FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<PropertyGroup>
<FSharpSourcesRoot>$(RepoRoot)src</FSharpSourcesRoot>
<SymStoreDirectory>$(ArtifactsDir)\SymStore</SymStoreDirectory>
<ProtoOutputPath Condition="'$(OS)' != 'Unix'">$(ArtifactsDir)\Bootstrap</ProtoOutputPath>
<ProtoOutputPath Condition="'$(OS)' == 'Unix'">$(ArtifactsDir)/fsc/Proto/netcoreapp2.1</ProtoOutputPath>
<ProtoOutputPath>$(ArtifactsDir)\Bootstrap</ProtoOutputPath>
<ValueTupleImplicitPackageVersion>4.4.0</ValueTupleImplicitPackageVersion>
<WarningsAsErrors>1182;0025;$(WarningsAsErrors)</WarningsAsErrors>
</PropertyGroup>
Expand Down Expand Up @@ -96,10 +95,10 @@

<!-- SDK targets override -->
<PropertyGroup Condition="'$(Configuration)' != 'Proto' AND '$(DisableCompilerRedirection)'!='true' AND Exists('$(ProtoOutputPath)')">
<FSharpTargetsPath>$(ProtoOutputPath)\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpPropsShim>$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props</FSharpPropsShim>
<FSharpTargetsShim>$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets</FSharpTargetsShim>
<FSharpOverridesTargetsShim>$(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets</FSharpOverridesTargetsShim>
<FSharpTargetsPath>$(ProtoOutputPath)\fsc\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpPropsShim>$(ProtoOutputPath)\fsc\Microsoft.FSharp.NetSdk.props</FSharpPropsShim>
<FSharpTargetsShim>$(ProtoOutputPath)\fsc\Microsoft.FSharp.NetSdk.targets</FSharpTargetsShim>
<FSharpOverridesTargetsShim>$(ProtoOutputPath)\fsc\Microsoft.FSharp.Overrides.NetSdk.targets</FSharpOverridesTargetsShim>
</PropertyGroup>

</Project>
6 changes: 3 additions & 3 deletions FSharpTests.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

<!-- SDK targets override -->
<PropertyGroup>
<_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'net40'">net472</_FSharpBuildTargetFramework>
<_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'coreclr'">netcoreapp2.1</_FSharpBuildTargetFramework>
<_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\FSharp.Build\$(Configuration)\$(_FSharpBuildTargetFramework)</_FSharpBuildBinPath>
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472</_FSharpBuildTargetFramework>
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1</_FSharpBuildTargetFramework>
<_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)</_FSharpBuildBinPath>

<FSharpBuildAssemblyFile>$(_FSharpBuildBinPath)\FSharp.Build.dll</FSharpBuildAssemblyFile>

Expand Down
7 changes: 4 additions & 3 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function Print-Usage() {
Write-Host ""
Write-Host "Actions:"
Write-Host " -restore Restore packages (short: -r)"
Write-Host " -norestore Don't restore packages"
Write-Host " -build Build main solution (short: -b)"
Write-Host " -rebuild Rebuild main solution"
Write-Host " -pack Build NuGet packages, VS insertion manifests and installer"
Expand Down Expand Up @@ -106,6 +107,7 @@ function Process-Arguments() {
Print-Usage
exit 0
}
$script:nodeReuse = $False;
dsyme marked this conversation as resolved.
Show resolved Hide resolved

if ($testAll) {
$script:testDesktop = $True
Expand Down Expand Up @@ -143,7 +145,7 @@ function Process-Arguments() {
}

function Update-Arguments() {
if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc.exe")) {
if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.exe")) {
$script:bootstrap = $True
}
}
Expand Down Expand Up @@ -177,7 +179,6 @@ function BuildSolution() {
/p:Publish=$publish `
/p:ContinuousIntegrationBuild=$ci `
/p:OfficialBuildId=$officialBuildId `
/p:BootstrapBuildPath=$bootstrapDir `
/p:QuietRestore=$quietRestore `
/p:QuietRestoreBinaryLog=$binaryLog `
/p:TestTargetFrameworks=$testTargetFrameworks `
Expand Down Expand Up @@ -211,7 +212,7 @@ function UpdatePath() {
}

function VerifyAssemblyVersions() {
$fsiPath = Join-Path $ArtifactsDir "bin\fsi\Proto\net472\fsi.exe"
$fsiPath = Join-Path $ArtifactsDir "bin\fsi\Proto\net472\publish\fsi.exe"

# Only verify versions on CI or official build
if ($ci -or $official) {
Expand Down
18 changes: 7 additions & 11 deletions eng/build-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function Get-PackageDir([string]$name, [string]$version = "") {
return $p
}

function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]$logFileName = "", [switch]$parallel = $true, [switch]$summary = $true, [switch]$warnAsError = $true, [string]$configuration = $script:configuration) {
function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]$logFileName = "", [switch]$parallel = $true, [switch]$summary = $true, [switch]$warnAsError = $true, [string]$configuration = $script:configuration, [string]$verbosity = $script:verbosity) {
# Because we override the C#/VB toolset to build against our LKG package, it is important
# that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise,
# we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211.
Expand Down Expand Up @@ -216,10 +216,6 @@ function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]
$args += " /p:ContinuousIntegrationBuild=true"
}

if ($bootstrapDir -ne "") {
dsyme marked this conversation as resolved.
Show resolved Hide resolved
$args += " /p:BootstrapBuildPath=$bootstrapDir"
}

$args += " $buildArgs"
$args += " $projectFilePath"
$args += " $properties"
Expand All @@ -241,15 +237,15 @@ function Make-BootstrapBuild() {
Create-Directory $dir

# prepare FsLex and Fsyacc
Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Build" -logFileName "BuildTools" -configuration $bootstrapConfiguration
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\*" -Destination $dir
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\*" -Destination $dir
Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Publish" -logFileName "BuildTools" -configuration $bootstrapConfiguration
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fslex" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fsyacc" -Force -Recurse

# prepare compiler
$projectPath = "$RepoRoot\proto.proj"
Run-MSBuild $projectPath "/restore /t:Build" -logFileName "Bootstrap" -configuration $bootstrapConfiguration
Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm\*" -Destination $dir
Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm\*" -Destination $dir
Run-MSBuild $projectPath "/restore /t:Publish" -logFileName "Bootstrap" -configuration $bootstrapConfiguration
Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsc" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsi" -Force -Recurse

return $dir
}
38 changes: 30 additions & 8 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ usage()
echo " --binaryLog Create MSBuild binary log (short: -bl)"
echo ""
echo "Actions:"
echo " --bootstrap Force the build of the bootstrap compiler"
echo " --restore Restore projects required to build (short: -r)"
echo " --norestore Don't restore projects required to build"
echo " --build Build all projects (short: -b)"
echo " --rebuild Rebuild all projects"
echo " --pack Build nuget packages"
Expand Down Expand Up @@ -54,6 +56,7 @@ test_core_clr=false
configuration="Debug"
verbosity='minimal'
binary_log=false
force_bootstrap=false
ci=false
skip_analyzers=false
prepare_machine=false
Expand Down Expand Up @@ -88,6 +91,9 @@ while [[ $# > 0 ]]; do
--binarylog|-bl)
binary_log=true
;;
--bootstrap)
force_bootstrap=true
;;
--restore|-r)
restore=true
;;
Expand Down Expand Up @@ -205,17 +211,33 @@ function BuildSolution {
quiet_restore=true
fi

# Node reuse fails because multiple different versions of FSharp.Build.dll get loaded into MSBuild nodes
node_reuse=false
dsyme marked this conversation as resolved.
Show resolved Hide resolved

# build bootstrap tools
bootstrap_config=Proto
MSBuild "$repo_root/src/buildtools/buildtools.proj" \
/restore \
/p:Configuration=$bootstrap_config \
/t:Build

bootstrap_dir=$artifacts_dir/Bootstrap
mkdir -p "$bootstrap_dir"
cp $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.1/* $bootstrap_dir
cp $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp2.1/* $bootstrap_dir
if [[ "$force_bootstrap" == true ]]; then
rm -fr $bootstrap_dir
fi
if [ ! -f "$bootstrap_dir/fslex.dll" ]; then
MSBuild "$repo_root/src/buildtools/buildtools.proj" \
/restore \
/p:Configuration=$bootstrap_config \
/t:Publish

mkdir -p "$bootstrap_dir"
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fslex
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsyacc
fi
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
MSBuild "$repo_root/proto.proj" \
/restore \
/p:Configuration=$bootstrap_config \
/t:Publish

cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsc
fi

# do real build
MSBuild $toolset_build_proj \
Expand Down
1 change: 0 additions & 1 deletion fcs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful -->
<ToolsetFsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools</ToolsetFsiToolPath>
<ToolsetFsiToolExe>fsi.exe</ToolsetFsiToolExe>
<ProtoOutputPath>$(ArtifactsBinDir)\FSharp.Build\Proto\net472</ProtoOutputPath>
<FcsFSharpCorePkgVersion>4.6.2</FcsFSharpCorePkgVersion>
<FcsTargetNetFxFramework>net461</FcsTargetNetFxFramework>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions proto.proj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<MSBuild Projects="@(Projects)" Targets="Rebuild" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

<Target Name="Publish">
<MSBuild Projects="@(Projects)" Targets="Publish" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

<Target Name="Clean">
<MSBuild Projects="@(Projects)" Targets="Clean" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>
Expand Down
13 changes: 7 additions & 6 deletions src/buildtools/buildtools.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@

<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
</PropertyGroup>
<DisableCompilerRedirection>true</DisableCompilerRedirection>
</PropertyGroup>

<ItemGroup>
<Projects Include="fslex\fslex.fsproj" />
<Projects Include="fsyacc\fsyacc.fsproj" />
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(Projects)" Targets="Build" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="@(Projects)" Targets="Build" Properties="Configuration=$(Configuration);DisableCompilerRedirection=$(DisableCompilerRedirection)" />
</Target>

<Target Name="Rebuild">
<MSBuild Projects="@(Projects)" Targets="Rebuild" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="@(Projects)" Targets="Rebuild" Properties="Configuration=$(Configuration);DisableCompilerRedirection=$(DisableCompilerRedirection)" />
</Target>

<Target Name="Clean">
<MSBuild Projects="@(Projects)" Targets="Clean" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="@(Projects)" Targets="Clean" Properties="Configuration=$(Configuration);DisableCompilerRedirection=$(DisableCompilerRedirection)" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(Projects)" Targets="Restore" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="@(Projects)" Targets="Restore" Properties="Configuration=$(Configuration);DisableCompilerRedirection=$(DisableCompilerRedirection)" />
</Target>

<Target Name="Publish">
<MSBuild Projects="@(Projects)" Targets="Publish" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="@(Projects)" Targets="Publish" Properties="Configuration=$(Configuration);DisableCompilerRedirection=$(DisableCompilerRedirection)" />
</Target>

</Project>
4 changes: 2 additions & 2 deletions src/buildtools/buildtools.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
BeforeTargets="CoreCompile">

<PropertyGroup>
<FsLexPath Condition="'$(FsLexPath)' == ''">$(ArtifactsDir)\Bootstrap\fslex.dll</FsLexPath>
<FsLexPath Condition="'$(FsLexPath)' == ''">$(ArtifactsDir)\Bootstrap\fslex\fslex.dll</FsLexPath>
</PropertyGroup>

<!-- Create the output directory -->
Expand All @@ -43,7 +43,7 @@
BeforeTargets="CoreCompile">

<PropertyGroup>
<FsYaccPath Condition="'$(FsYaccPath)' == ''">$(ArtifactsDir)\Bootstrap\fsyacc.dll</FsYaccPath>
<FsYaccPath Condition="'$(FsYaccPath)' == ''">$(ArtifactsDir)\Bootstrap\fsyacc\fsyacc.dll</FsYaccPath>
</PropertyGroup>

<!-- Create the output directory -->
Expand Down
8 changes: 4 additions & 4 deletions src/fsharp/fsi/fsi.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\FSharp.Core\FSharp.Core.fsproj" />
<ProjectReference Include="..\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
<ProjectReference Include="..\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj" />

<!-- only used when '$(TargetFramework)' == 'net472' -->
<ProjectReference Include="..\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj" Condition="'$(TargetFramework)' == 'net472'" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj" Condition="'$(TargetFramework)' == 'net472'" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
Expand Down