Skip to content

Allow custom binlog names in common build scripts#16856

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/update-binlog-name-specification
Open

Allow custom binlog names in common build scripts#16856
Copilot wants to merge 3 commits into
mainfrom
copilot/update-binlog-name-specification

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

Sequential build steps using eng/common/build.ps1 and eng/common/build.sh always wrote to Build.binlog, so later steps overwrote earlier logs. This updates the common entrypoints to let callers choose the binlog file name or path while preserving the existing default.

  • Surface area

    • Add -binaryLogName / --binaryLogName with short form -bln to the common PowerShell and Bash build scripts.
    • Keep -binaryLog / --binaryLog behavior unchanged.
  • Behavior

    • Supplying a binlog name implicitly enables binary logging.
    • Relative paths are rooted under the existing log directory.
    • Absolute paths are passed through as-is.
    • Default output remains artifacts/log/<Configuration>/Build.binlog.
  • Example

    eng/common/build.sh --build --restore --binaryLogName Build.restore.binlog
    eng/common/build.sh --build --binaryLogName Build.compile.binlog
    eng/common/build.ps1 -build -restore -binaryLogName Build.restore.binlog
    eng/common/build.ps1 -build -binaryLogName Build.compile.binlog

To double check:

Copilot AI requested review from Copilot and removed request for Copilot May 20, 2026 22:33
Copilot AI requested review from Copilot and removed request for Copilot May 20, 2026 22:36
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/ce64dfe8-f0c3-4d1e-a8c4-d86622772957

Co-authored-by: mmitche <8725170+mmitche@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 20, 2026 22:37
Copilot AI changed the title [WIP] Update build.ps1 to allow specification of binlog name Allow custom binlog names in common build scripts May 20, 2026
Copilot AI requested a review from mmitche May 20, 2026 22:38
@mmitche mmitche marked this pull request as ready for review May 20, 2026 23:01
Copilot AI review requested due to automatic review settings May 20, 2026 23:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Arcade’s common build entrypoints (eng/common/build.sh and eng/common/build.ps1) to allow callers to specify a custom MSBuild binlog file name/path so sequential build steps don’t overwrite Build.binlog, while preserving the existing default output location and behavior.

Changes:

  • Add --binaryLogName / -binaryLogName (alias -bln) to specify a binlog file name or path and implicitly enable binary logging.
  • Resolve relative binlog paths under the existing log directory and pass absolute paths through unchanged.
  • Ensure the target directory for the binlog is created before invoking MSBuild.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
eng/common/build.sh Adds --binaryLogName arg parsing and custom /bl: path selection for MSBuild.
eng/common/build.ps1 Adds -binaryLogName parameter and computes/creates the custom binlog path when binary logging is enabled.

Comment thread eng/common/build.sh
Comment on lines 240 to +252
local bl=""
if [[ "$binary_log" == true ]]; then
bl="/bl:\"$log_dir/Build.binlog\""
local binary_log_path=""
if [[ -z "$binary_log_name" ]]; then
binary_log_path="$log_dir/Build.binlog"
elif [[ "$binary_log_name" = /* ]]; then
binary_log_path="$binary_log_name"
else
binary_log_path="$log_dir/$binary_log_name"
fi

mkdir -p "$(dirname "$binary_log_path")"
bl="/bl:\"$binary_log_path\""
@mmitche
Copy link
Copy Markdown
Member

mmitche commented May 20, 2026

@MichaelSimons This is to fix an issue in sdk's CI that prevents analysis of the build binlogs because the second build step (full framework build) overwerites the Build.binlog of the original build step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

binaryLog option to build.ps1 should allow for specification of the build log name

3 participants