Skip to content

strong signing build tools binaries#5071

Closed
shahabhijeet wants to merge 2 commits intoAzure:LTSBuildToolsfrom
shahabhijeet:snSign
Closed

strong signing build tools binaries#5071
shahabhijeet wants to merge 2 commits intoAzure:LTSBuildToolsfrom
shahabhijeet:snSign

Conversation

@shahabhijeet
Copy link
Contributor

Strong signing build tools binaries

@@ -0,0 +1,11 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
Copy link
Member

Choose a reason for hiding this comment

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

nit: Most msbuild xml files use 2 space indention without tabs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weshaggard I need to fix my indentation just for xml files in all the various editors I use. I have not been able to get set those defaults just for xml across VS, VSCode and notepad++
I will fix this very soon.

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<OutputPath>$(TaskBinaryOutput)</OutputPath>
<DelaySign>false</DelaySign>
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't need this because you set it in buildtools.props

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wedebols good catch, will remove this.

<IsBuildToolsProject>true</IsBuildToolsProject>
</PropertyGroup>

<PropertyGroup Condition=" '$(IsBuildToolsProject)' == 'true' ">
Copy link
Member

Choose a reason for hiding this comment

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

Why condition this here? I don't see any way that IsBuildToolsProject isn't true from this spot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weshaggard there are often times when the build scripts evolve and properties get rearranged.
This is just to keep clear that this property group is applicable only under the certain condition.
So in case ever the property group above (line 3) ever get's into any other file, having the condition check right now will save me lot of headache, if I ever forget to add that condition back in.

Copy link
Member

Choose a reason for hiding this comment

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

OK that seems a little overkill to me but I don't have an issue with it. I would have just put both of them in the same property group to indicate that they are connected.

There are certain projects that needs internals visible for test purpose
<!-- AND ('$(CodeSign)' == 'true')
<PropertyGroup Condition=" ('$(IsBuildToolsProject)' == 'false' OR '$(IsBuildToolsProject)' == '') ">
Copy link
Member

Choose a reason for hiding this comment

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

If you only ever set IsBuildToolsProject to true I would change this condition to '$(IsBuildToolsProject)' != 'true'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weshaggard sounds good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I did not realized in the PR that the code was comment out.
There is no condition for IsBuildToolsProject == false anymore. The code that you see is commented out, so we are good.

</PropertyGroup>
-->
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Copy link
Member

Choose a reason for hiding this comment

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

Do you still need to set GenerateAssemblyInfo = false?

@@ -18,38 +18,29 @@
<BuildWideDebugTrace Condition=" '$(DebugTrace)' == '' ">false</BuildWideDebugTrace>
Copy link
Member

Choose a reason for hiding this comment

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

You probably need to condition DelaySign property above to make sure it doesn't override something setting it before like the buildtools.props.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weshaggard you mean, check for if it's set to false and if yes, set it to true? Is that what you mean by conditioning the setter for the DelaySign?
Also buildtools.props is not included in any build workflow, unless you are building the buildtools projects. Do you still anticipate buildtools.prop overriding any defaults for normal workflow?
Also buildtools.props will never be merged to the master repo.

Copy link
Member

Choose a reason for hiding this comment

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

I was meaning something like <DelaySign Condition="'$(DelaySign)' == ''>true</DelaySign> . Just default it to true if it isn't already set to something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weshaggard but dont' we want to just set it to true by default regardless of what the existing value is?
And it will get overridden while building build tools project to false.
Maybe I am missing to understand why it has to be conditioned in the global scope?

Copy link
Member

Choose a reason for hiding this comment

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

Assuming nothing imported before this is expected to set DelaySign then it is fine to always set it explicitly.

@shahabhijeet
Copy link
Contributor Author

@weshaggard I will merge #5071 once all your PRs are merged. Please let me know if there is anything that I have not addressed to your feedback.
I am already getting merge conflicts, will resolve once all your PRs are in.

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<OutputPath>$(TaskBinaryOutput)</OutputPath>
<AssemblyOriginatorKeyFile>D:\myFork\LTSBuild\tools\BuildTools.snk</AssemblyOriginatorKeyFile>
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this redundant with what is is in buildtools.props?

@shahabhijeet
Copy link
Contributor Author

Closing this PR in lieu of #5076

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.

2 participants