Skip to content

Skip symlinks when creating SBOM for source tarball - #232

Merged
ambv merged 2 commits into
python:masterfrom
hugovk:skip-sbom-symlinks
Apr 8, 2025
Merged

Skip symlinks when creating SBOM for source tarball#232
ambv merged 2 commits into
python:masterfrom
hugovk:skip-sbom-symlinks

Conversation

@hugovk

Copy link
Copy Markdown
Member
Building an SBOM for artifact 'Python-3.14.0a7.tgz'
💥 Building SBOM artifacts
Traceback (most recent call last):
File "/Users/hugo/github/release-tools/run_release.py", line 1388, in <module>
main()
File "/Users/hugo/github/release-tools/run_release.py", line 1384, in main
automata.run()
File "/Users/hugo/github/release-tools/run_release.py", line 248, in runraise e fromNone
File "/Users/hugo/github/release-tools/run_release.py", line 245, in runself.current_task(self.db)
File "/Users/hugo/github/release-tools/release.py", line 126, in __call__returngetattr(self, "function")(db)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hugo/github/release-tools/run_release.py", line 656, in build_sbom_artifacts
sbom_data = sbom.create_sbom_for_source_tarball(tarball_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hugo/github/release-tools/sbom.py", line 616, in create_sbom_for_source_tarballassert member.isfile() and member.name.startswith(f"Python-{cpython_version}/")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

That's because Python-3.14.0a7/Misc/mypy/_colorize.py is a symlink and member.isfile() is False.

Because https://github.com/python/cpython/tree/main/Misc/mypy now has symlinks, added in python/cpython#131509.

Let's skip them.

@hugovk
hugovk requested a review from sethmlarsonApril 8, 2025 12:22
Comment threadsbom.py Outdated
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

@sethmlarsonsethmlarson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@ambv
ambv merged commit 267346a into python:masterApr 8, 2025
@hugovk
hugovk deleted the skip-sbom-symlinks branch April 8, 2025 14:42
Sign up for freeto 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.

4 participants

@hugovk@AA-Turner@sethmlarson@ambv