Track sourceLink and resources in deterministic key#81629
Conversation
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
|
@copilot CI produced |
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
Fixed in 08c5f38. Removed the unused Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot |
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
Fixed in e4530d3. Removed the redundant Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot We should care about the ruleset contents, not just the path to the ruleset file |
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
Fixed in 2fac371. Changed from tracking ruleset file path to tracking ruleset content with checksum (similar to source link). The ruleset file is now opened and read as SourceText, with its checksum written to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Remove IsEmbedded. It is redundant with FileName and we need FileName for non-embedded scenarios |
Co-authored-by: jcouv <12466233+jcouv@users.noreply.github.com>
| using var stream = resource.DataProvider(); | ||
| var sourceText = SourceText.From(stream, encoding: null, checksumAlgorithm: SourceHashAlgorithms.Default); | ||
| WriteSourceText(writer, sourceText); |
There was a problem hiding this comment.
Why are you converting to a SourceText here? These resources are generally treated as binary blobs in the codebase. My intuition would be that we just grab the raw Stream or byte[] and hash that. Not sure if we'd hit weird edge cases trying to view a binary as a source text.
|
...
"resources": [
{
"resourceName": "Microsoft.VisualStudio.IntegrationTestService.dll",
"fileName": null,
"isPublic": true,
"content": {
"checksum": "da3a9f2c2fc2de2bf0254f9f13e15726c7a260ab318acff9a77790ccc344a",
"checksumAlgorithm": "Sha256"
}
},
{
"resourceName": "Microsoft.VisualStudio.IntegrationTestService.vsix",
"fileName": null,
"isPublic": true,
"content": {
+ "checksum": "c88fbb3f45e9c061775c57b763ba4e3988857883a253d03ac7bed44bf113af9c", // Right
- "checksum": "876736d2ee98f2c4cac77a7fac592adbd14924d583f914cf873dc67366c2f8c", // Left
"checksumAlgorithm": "Sha256"
}
}
]
} |
| # The VSIX build is not deterministic (for example the catalog.json contains a randomly generated identifier for the install location). | ||
| "Microsoft.VisualStudio.Extensibility.Testing.Xunit.dll" | ||
| "Microsoft.VisualStudio.Extensibility.Testing.Xunit.dll", | ||
| "Microsoft.VisualStudio.Extensibility.Testing.Xunit.dll.key" |
There was a problem hiding this comment.
Yes, the key file didn't use to include some inputs, which are not the same across rebuilds (ie. a VSIX file). Now the key file includes them and thus varies across rebuilds as well.
This PR adds tracking for source link files and resources to the compiler's deterministic key file to ensure all compilation inputs that affect reproducible builds are properly tracked. The implementation includes calculating checksums for source link content and manifest resources (tracking name, fileName, isPublic, and content checksum), while ruleset tracking was deemed unnecessary since rulesets only affect compilation through diagnostic options that are already being tracked.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.