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

Fix signing in PR runs #31926

Merged
merged 1 commit into from
Feb 10, 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
6 changes: 1 addition & 5 deletions eng/pipelines/installer/jobs/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ jobs:
eq(parameters.isOfficialBuild, true),
ne(parameters.crossrootfsDir, '')) }}

# TODO: (Consolidation) Enable test signing during PR validation. https://github.com/dotnet/runtime/issues/1026
#
# CoreCLR only produces the UCRT redist file in Release config. When the redist file isn't
# present, signing fails. For now, only sign in official builds which only run Release mode.
- name: SignType
value: ''
value: test

# Set up non-PR build from internal project
- ${{ if eq(parameters.isOfficialBuild, true) }}:
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<UcrtFilesToCopy Include="$(UniversalCRTSDKDir)Redist\ucrt\DLLs\$(BuildArch)\*.dll" />
Copy link
Member

Choose a reason for hiding this comment

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

In the case for debug, don't we need ucrtbased.dll?

Copy link
Member Author

Choose a reason for hiding this comment

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

@dagood - could you please take a look at the below run? I think I see some installer runs passing but I don't know for sure. @hoyoys - I must admit I have no idea, nor does Matt whom I asked as he originally added this bit. Can you please elaborate? I was under the impression the the redistributable Universal CRT used to be a replacement for the Win32 API DLLs that appeared in later Windows versions but I may be certainly missing something.

Copy link
Member

@hoyosjs hoyosjs Feb 8, 2020

Choose a reason for hiding this comment

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

I must admit I have no idea, nor does Matt whom I asked as he originally added this bit.

We added the UCRT and API shims as a way to support older windows versions (for example API* is only needed on win7). If it's a debug build, we'd need ucrtbased.dll and such variants. Given that we statically link the CRT files no issues, other than UCRT. As for why we sign them here, if we don't resign them ourselves here, we'd be shipping an API shim that's not Authenticode signed.

Copy link
Member

Choose a reason for hiding this comment

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

That being said, the only one that needs to be signed is that one API shim.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, you know I'm no expert here. Given we're not actually publishing / shipping anything in the PR runs, just doing dry runs of some installer signing magic presumably using some test certificates - what additional changes would you suggest?

Copy link
Member

Choose a reason for hiding this comment

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

If this is only going to be for test-signing, then it doesn't matter if the file is there unless we turn on signing validation or test on windows 7

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Juan for your additional feedback. I defer to Davis to comment on this in greater detail as in this particular case I'm just a trained monkey mechanically trying out a combo of two code changes. Have a great weekend!

</ItemGroup>

<Copy Condition="'$(BuildType)'=='Release' AND '$(BuildArch)' != 'arm64'"
<Copy Condition="'$(BuildArch)' != 'arm64'"
SourceFiles="@(UcrtFilesToCopy)"
DestinationFolder="$(BinDir)Redist\ucrt\DLLs\$(BuildArch)" />
</Target>
Expand Down