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

Add SBOMs generation for Windows artifacts #99

Closed
wants to merge 1 commit into from

Conversation

sethmlarson
Copy link
Collaborator

Requires python/cpython#115789 to be checked in to work.

  • Does checkout.yml essentially pull CPython's source code into the release-tools directory?
  • Do the Windows artifacts have pip included? I couldn't find it in ensurepip for the embed artifacts
  • Is it possible to run Azure Pipelines off of a branch besides master so I can test this code before enabling it for future releases?

cc @zooba

@sethmlarson sethmlarson changed the title Start of Windows artifact SBOMs Add SBOMs generation for Windows artifacts Feb 22, 2024
@zooba
Copy link
Member

zooba commented Feb 22, 2024

Does checkout.yml essentially pull CPython's source code into the release-tools directory?

Best to assume it clones into $(Build.SourcesDirectory) or else just the default current working directory.

Do the Windows artifacts have pip included? I couldn't find it in ensurepip for the embed artifacts

I think we get it from ensurepip? The embedded distro does not, as it's not really the point (you'd install packages when you build your app and then redistribute the whole thing ready to go).

  • Is it possible to run Azure Pipelines off of a branch besides master so I can test this code before enabling it for future releases?

Yes, but much easier if you push to the main repo rather than a fork. Then your branch will appear in the dropdown when you go to queue the build.

To run from a fork you'd need to change the repo it's associated with, which would upset me because I'm also working in this pipeline at the moment and it would spoil my testing 😆

- powershell: >
python
"$(Build.SourcesDirectory)\sbom.py"
(gci msi\*\python-*.exe | select -First 1)
Copy link
Member

Choose a reason for hiding this comment

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

Any reason we wouldn't/shouldn't just do all of them? (Omitting the select -First 1 should pass them all as separate args, and then sys.argv[1:] in Python can get them all.)

Comment on lines +41 to +45
- task: PublishPipelineArtifact@0
displayName: 'Publish artifact: sbom'
inputs:
targetPath: '$(Build.BinariesDirectory)\sbom'
artifactName: sbom
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- task: PublishPipelineArtifact@0
displayName: 'Publish artifact: sbom'
inputs:
targetPath: '$(Build.BinariesDirectory)\sbom'
artifactName: sbom
- publish: '$(Build.BinariesDirectory)\sbom'
artifact: sbom
displayName: 'Publish artifact: sbom'

This is the preferred format for simple cases now (should auto-update when they need to make changes to the publish task).

@@ -218,7 +224,7 @@ stages:
- ${{ if eq(parameters.DoMSI, 'true') }}:
- stage: PublishPyDotOrg
displayName: Publish to python.org
dependsOn: ['Test_MSI', 'Test']
dependsOn: ['SBOM', 'Test_MSI', 'Test']
jobs:
- template: stage-publish-pythonorg.yml
Copy link
Member

Choose a reason for hiding this comment

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

I assume we're going to get chances to this template as well to SSH the files up to the server?

Copy link
Collaborator Author

@sethmlarson sethmlarson Feb 23, 2024

Choose a reason for hiding this comment

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

Yeah that's the plan, I might do that in a follow-up PR though. Maybe I'll remove this dependsOn for now.

@sethmlarson
Copy link
Collaborator Author

Thanks for the review @zooba, I've closed this PR and created a new one on this repo for easier testing and addressed your comments in the new PR.

@sethmlarson sethmlarson deleted the windows-externals branch February 23, 2024 16:46
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