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

Customize binary log name #12988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Customize binary log name #12988

wants to merge 1 commit into from

Conversation

jaredpar
Copy link
Member

@jaredpar jaredpar commented Mar 29, 2023

There is no easy way to customize the binary log name when using build.ps1 today. That means you can't have a different binary log for build and restore steps. Add a name parameter so it can be customized.

To double check:

There is no easy way to customize the binary log name when using
build.ps1 today. That means you can't have a different binary log for
build and restore steps. Add a name parameter so it can be customized.
@@ -93,7 +95,7 @@ function Build {
$toolsetBuildProj = InitializeToolset
InitializeCustomToolset

$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir $binaryLogName) } else { '' }
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems it's possible to pass another /bl: flag with a custom name today:

https://github.com/dotnet/sdk/blob/ec824c9797659318c772330cb176286643a25dfe/eng/build.yml#L91

Although you still have to provide full path.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are a few issues with using /bl

  1. It feels a bit broken. It's essentially using a trick that / won't be picked up by PowerShell so it falls through to the extra args.
  2. Consider that -ci will effectively force $binaryLog to be $true. That means the line here gets invoked and added to the argument list. Today that works because it gets added first so the /bl flag we add wins but this could easily get broken if later on the argument order is reversed.
  3. As you noted it requires us to provide the full path. That feels like it breaks the arcade abstraction a bit. If they decide to later on change the layout of artifacts then our scripts are broken.

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.

None yet

2 participants