Skip to content

Remove the duplicated args#15650

Closed
Winniexu01 wants to merge 3 commits intodotnet:mainfrom
Winniexu01:RemoveDupArgs
Closed

Remove the duplicated args#15650
Winniexu01 wants to merge 3 commits intodotnet:mainfrom
Winniexu01:RemoveDupArgs

Conversation

@Winniexu01
Copy link
Member

Fix dotnet/source-build#3789

Remove the duplicated args from the outer repo build command if the args have been added to the inner repo build command.

@Winniexu01 Winniexu01 requested a review from a team as a code owner March 18, 2025 02:22
@Winniexu01
Copy link
Member Author

Add @mmitche as a reviewer.

Copy link
Member

@MichaelSimons MichaelSimons left a comment

Choose a reason for hiding this comment

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

What validation has been performed on these changes?

bl="/bl:\"$log_dir/Build.binlog\""
fi

[[ $properties != *"/p:Configuration"* ]] && properties="$properties /p:Configuration=$configuration"
Copy link
Member

Choose a reason for hiding this comment

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

Aren't these case sensitive matches? Do we need to worry about doing a case insensitive match?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a good point, please check the commit: 80a0a3e

@MichaelSimons MichaelSimons requested review from a team and mmitche March 18, 2025 14:18
@ViktorHofer
Copy link
Member

I'm not sure I like this direction. We were discussing removing the inner-build eventually which would fix this issue: dotnet/source-build#4249

fi

[[ $properties != *"/p:Configuration"* ]] && properties="$properties /p:Configuration=$configuration"
[[ $properties != *"/p:RepoRoot"* ]] && properties="$properties /p:RepoRoot=\"$repo_root\""
Copy link
Member

Choose a reason for hiding this comment

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

Can this logic be put into a function that get's called? Something like:

function AddPropertyIfMissing {
  local property_name=$1
  local property_value=$2

  if [[ $properties != *"/p:$property_name"* ]]; then
    properties="$properties /p:$property_name=$property_value"
  fi
}
...
AddPropertyIfMissing "Configuration" "$configuration"

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, please check the commit: 80a0a3e

<Target Name="RunInnerSourceBuildCommand"
DependsOnTargets="PrepareInnerSourceBuildRepoRoot">
<ItemGroup Condition="'$(BaseInnerSourceBuildCommand)' == ''">
<InnerCommands Include="$(ARCADE_BUILD_TOOL_COMMAND.Split(' '))" />
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this will work...if there is a space in a command (e.g. a file path), it'll split on that.

Copy link
Member

@mmitche mmitche left a comment

Choose a reason for hiding this comment

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

I don't think this needs to be all that complex. I think that the main duplication we see is from this block:

https://github.com/dotnet/arcade/pull/15650/files#diff-7f4573fc348a9655a402335c969386d026b189013273f078ca52890a18a84d15R56-R73

Where we re-pass args that are already present. e.g. ContinuousIntegrationBuild

I would test this in the VMR build first. The changes are trivial to make in the arcade directory and then run a draft PR in the dotnet/dotnet repo.

@Winniexu01
Copy link
Member Author

Just like @ViktorHofer said, the dotnet/source-build#3789 will be fixed in the future: dotnet/source-build#4249. Close this pr.

@Winniexu01 Winniexu01 closed this Mar 20, 2025
@Winniexu01 Winniexu01 deleted the RemoveDupArgs branch March 27, 2025 01:56
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.

Inner repo builds should not double pass args

5 participants