Skip to content
Merged
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

<!-- add missing entry for .msi, this can be removed once aspire uses arcade 10.0 -->
<FileExtensionSignInfo Include=".msi" CertificateName="MicrosoftDotNet500" Condition="!@(FileExtensionSignInfo->AnyHaveMetadataValue('Identity', '.msi'))" />

<!-- Remove .py files from being signed. See https://github.com/dotnet/aspire/issues/13004 -->
<FileExtensionSignInfo Remove=".ps1;.psd1;.psm1;.psc1;.py" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need to remove then re-include the non-.py file extensions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In MSBuild you can't change an "Include" on an Item as that's it's ID. In order to modify the "Include", you need to remove the whole Item, and then readd it with the updated value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm, I'm a bit worried about this here as we would be potentially exposed to any change of this list in a future arcade update. I wonder if with a bit more code but we could just instead calculate on the fly what the Include value is based on searching for .py, and then adding it back but replacing the .py with empty string would work?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let me know if you want me to work on the above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think a more maintainable solution would be for us to get arcade updated to support this scenario. Similar to Do not sign .js files by default (dotnet/arcade#15760).

cc @ellahathaway

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the SLA for things like this plus us taking a new arcade version (that we frequently revert?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In MSBuild you can't change an "Include" on an Item as that's it's ID. In order to modify the "Include", you need to remove the whole Item, and then readd it with the updated value.

Are you sure about that? AFAIU, with the ; the items will get split up, and they will become individual items. What do you get if you print the items with %(Identity)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call @radical. I tested it in an isolated csproj:

    <ItemGroup>
        <FileExtensionSignInfo Include=".ps1;.psd1;.psm1;.psc1;.py" Foo="bar" />
        <FileExtensionSignInfo Remove=".py" />
    </ItemGroup>

    <Target Name="PrintInfo" BeforeTargets="Build">
      <Message Importance="High" Text="FileExtensionSignInfo items:" />
      <Message Importance="High" Text="  @(FileExtensionSignInfo->'%(Identity) - %(Foo)')" />
    </Target>

Produces

image

<FileExtensionSignInfo Include=".ps1;.psd1;.psm1;.psc1" CertificateName="Microsoft400" />
Comment thread
radical marked this conversation as resolved.
Outdated
</ItemGroup>

<ItemGroup>
Expand Down