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
2 changes: 1 addition & 1 deletion eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<Exec
Command="./build.sh --bootstrap --skipBuild"
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
EnvironmentVariables="@(InnerBuildEnv)" />
EnvironmentVariables="@(InnerBuildEnv);DotNetBuildFromSource=true" />
</Target>

</Project>
51 changes: 28 additions & 23 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,29 +240,34 @@ function BuildSolution {
node_reuse=false

# build bootstrap tools
bootstrap_config=Proto
bootstrap_dir=$artifacts_dir/Bootstrap
if [[ "$force_bootstrap" == true ]]; then
rm -fr $bootstrap_dir
fi
if [ ! -f "$bootstrap_dir/fslex.dll" ]; then
BuildMessage="Error building tools"
MSBuild "$repo_root/src/buildtools/buildtools.proj" \
/restore \
/p:Configuration=$bootstrap_config

mkdir -p "$bootstrap_dir"
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net5.0 $bootstrap_dir/fslex
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net5.0 $bootstrap_dir/fsyacc
fi
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
BuildMessage="Error building bootstrap"
MSBuild "$repo_root/proto.proj" \
/restore \
/p:Configuration=$bootstrap_config \


cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net5.0 $bootstrap_dir/fsc
# source_build=true means we are currently in the outer/wrapper source-build,
# and building bootstrap needs to wait. The source-build targets will run this
# script again without setting source_build=true when it is done setting up
# the build environment. See 'eng/SourceBuild.props'.
if [[ "$source_build" != true ]]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume the source_build environment variable is set prior to running this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from the --sourceBuild arg--the environment value is discarded--but basically yes:

source_build=false

fsharp/eng/build.sh

Lines 140 to 141 in 8459d3a

--sourcebuild)
source_build=true

This is passed in by source-build here:

https://github.com/dotnet/installer/blob/9e8b04bbff820c93c142f99a507a46b976f5c14c/src/SourceBuild/tarball/content/repos/fsharp.proj#L7-L12

bootstrap_config=Proto
bootstrap_dir=$artifacts_dir/Bootstrap
if [[ "$force_bootstrap" == true ]]; then
rm -fr $bootstrap_dir
fi
if [ ! -f "$bootstrap_dir/fslex.dll" ]; then
BuildMessage="Error building tools"
MSBuild "$repo_root/src/buildtools/buildtools.proj" \
/restore \
/p:Configuration=$bootstrap_config

mkdir -p "$bootstrap_dir"
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net5.0 $bootstrap_dir/fslex
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net5.0 $bootstrap_dir/fsyacc
fi
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
BuildMessage="Error building bootstrap"
MSBuild "$repo_root/proto.proj" \
/restore \
/p:Configuration=$bootstrap_config

cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net5.0 $bootstrap_dir/fsc
fi
fi

if [[ "$skip_build" != true ]]; then
Expand Down
1 change: 1 addition & 0 deletions src/buildtools/AssemblyCheck/AssemblyCheck.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/buildtools/fslex/fslex.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants)</DefineConstants>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/buildtools/fsyacc/fsyacc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants)</DefineConstants>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/fsc/fsc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<AllowCrossTargeting>true</AllowCrossTargeting>
<NGenBinary>true</NGenBinary>
<UseAppHost>true</UseAppHost>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/fsi/fsi.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Win32Resource>fsi.res</Win32Resource>
<NGenBinary>true</NGenBinary>
<UseAppHost>true</UseAppHost>
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
</PropertyGroup>

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