Skip to content

Small fixes #21982

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

Merged
merged 2 commits into from
May 19, 2020
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
4 changes: 1 addition & 3 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
<configuration>
<packageSources>
<clear />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" />
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
<add key="aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
<add key="roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
<!-- Used for the SiteExtension 3.1 bits that are included in the 5.0 build -->
<add key="dotnet31-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json" />
Expand Down
20 changes: 10 additions & 10 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,7 @@ $RunRestore = if ($NoRestore) { $false }
# Target selection
$MSBuildArguments += "/p:Restore=$RunRestore"
$MSBuildArguments += "/p:Build=$RunBuild"
if (-not $RunBuild) {
$MSBuildArguments += "/p:NoBuild=true"
}
if (-not $RunBuild) { $MSBuildArguments += "/p:NoBuild=true" }
$MSBuildArguments += "/p:Pack=$Pack"
$MSBuildArguments += "/p:Test=$Test"
$MSBuildArguments += "/p:Sign=$Sign"
Expand Down Expand Up @@ -364,18 +362,20 @@ Remove-Item variable:global:_MSBuildExe -ea Ignore
# Import Arcade
. "$PSScriptRoot/eng/common/tools.ps1"

# Add default .binlog location if not already on the command line. tools.ps1 does not handle this; it just checks
# $BinaryLog, $CI and $ExcludeCIBinarylog values for an error case. But tools.ps1 provides a nice function to help.
if ($BinaryLog) {
$bl = GetMSBuildBinaryLogCommandLineArgument($MSBuildArguments)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the similar for loop in build.sh are somewhat better than was here before. The scripts won't bother to add a /bl:Build.binlog option if anything one starting with /bl: or /binaryLogger: (plus -bl: or -binaryLogger: in the build.sh case) already exists.

if (-not $bl) {
$MSBuildArguments += "/bl:" + (Join-Path $LogDir "Build.binlog")
}
}

# Capture MSBuild crash logs
$env:MSBUILDDEBUGPATH = $LogDir

$local:exit_code = $null
try {
# Import custom tools configuration, if present in the repo.
# Note: Import in global scope so that the script set top-level variables without qualification.
$configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1"
if (Test-Path $configureToolsetScript) {
. $configureToolsetScript
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was old cruft. Sourcing tools.ps1 sources this file for us already and makes all settings available in this scope. Same for the similar block near the end of build.sh.

# Set this global property so Arcade will always initialize the toolset. The error message you get when you build on a clean machine
# with -norestore is not obvious about what to do to fix it. As initialization takes very little time, we think always initializing
# the toolset is a better default behavior.
Expand Down
26 changes: 16 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ if [ -z "$configuration" ]; then
fi
msbuild_args[${#msbuild_args[*]}]="-p:Configuration=$configuration"

# Set verbosity
echo "Setting msbuild verbosity to $verbosity"
msbuild_args[${#msbuild_args[*]}]="-verbosity:$verbosity"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I didn't remove this, we end up with extra options on the msbuild command line because tools.sh handles $verbosity itself. Doesn't matter much but also doesn't help at all.

# Set up additional runtime args
toolset_build_args=()
if [ ! -z "$dotnet_runtime_source_feed$dotnet_runtime_source_feed_key" ]; then
Expand Down Expand Up @@ -328,15 +324,25 @@ fi
# Import Arcade
. "$DIR/eng/common/tools.sh"

# Add default .binlog location if not already on the command line. tools.sh does not handle this; it just checks
# $binary_log, $ci and $exclude_ci_binary_log values for an error case.
if [[ "$binary_log" == true ]]; then
found=false
for arg in "${msbuild_args[@]}"; do
opt="$(echo "${arg/#--/-}" | awk '{print tolower($0)}')"
if [[ "$opt" == [-/]bl:* || "$opt" == [-/]binarylogger:* ]]; then
found=true
break
fi
done
if [[ "$found" == false ]]; then
msbuild_args[${#msbuild_args[*]}]="/bl:$log_dir/Build.binlog"
fi
fi

# Capture MSBuild crash logs
export MSBUILDDEBUGPATH="$log_dir"

# Import custom tools configuration, if present in the repo.
configure_toolset_script="$eng_root/configure-toolset.sh"
if [[ -a "$configure_toolset_script" ]]; then
. "$configure_toolset_script"
fi

# Set this global property so Arcade will always initialize the toolset. The error message you get when you build on a clean machine
# with -norestore is not obvious about what to do to fix it. As initialization takes very little time, we think always initializing
# the toolset is a better default behavior.
Expand Down