You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2025/03/30 14:14:29 UTC

(buildstream-plugins) branch tristan/sboms created (now 762a16d)

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a change to branch tristan/sboms
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git


      at 762a16d  sources/cargo.py: Implement collect_source_info()

This branch includes the following new commits:

     new 995772b  sources/patch.py: Implement collect_source_info()
     new 762a16d  sources/cargo.py: Implement collect_source_info()

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(buildstream-plugins) 01/02: sources/patch.py: Implement collect_source_info()

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/sboms
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit 995772b06623046a3cf382c41d58c688cfbc4373
Author: Tristan van Berkom <tr...@upstairslabs.com>
AuthorDate: Sun Mar 30 18:25:49 2025 +0900

    sources/patch.py: Implement collect_source_info()
---
 src/buildstream_plugins/sources/patch.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/buildstream_plugins/sources/patch.py b/src/buildstream_plugins/sources/patch.py
index 1eece2b..fc157d0 100644
--- a/src/buildstream_plugins/sources/patch.py
+++ b/src/buildstream_plugins/sources/patch.py
@@ -48,7 +48,7 @@ details on common configuration options for sources.
 """
 
 import os
-from buildstream import Source, SourceError
+from buildstream import Source, SourceError, SourceInfo, SourceInfoMedium, SourceVersionType
 from buildstream import utils
 
 
@@ -114,6 +114,11 @@ class PatchSource(Source):
                 fail="Failed to apply patch {}".format(self.path),
             )
 
+    def collect_source_info(self):
+        return [
+            SourceInfo(self.path, SourceInfoMedium.LOCAL, SourceVersionType.SHA256, utils.sha256sum(self.fullpath))
+        ]
+
 
 # Plugin entry point
 def setup():


(buildstream-plugins) 02/02: sources/cargo.py: Implement collect_source_info()

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/sboms
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit 762a16deee22586f352f51e0f18cb1ac8c4ba39b
Author: Tristan van Berkom <tr...@upstairslabs.com>
AuthorDate: Sun Mar 30 18:41:52 2025 +0900

    sources/cargo.py: Implement collect_source_info()
---
 src/buildstream_plugins/sources/cargo.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/buildstream_plugins/sources/cargo.py b/src/buildstream_plugins/sources/cargo.py
index ff49cd9..dbddfe3 100644
--- a/src/buildstream_plugins/sources/cargo.py
+++ b/src/buildstream_plugins/sources/cargo.py
@@ -74,7 +74,7 @@ try:
 except ImportError:
     import tomli as tomllib  # type: ignore
 
-from buildstream import Source, SourceFetcher, SourceError
+from buildstream import Source, SourceFetcher, SourceError, SourceInfo, SourceInfoMedium, SourceVersionType
 from buildstream import utils
 
 from ._utils import download_file
@@ -332,6 +332,18 @@ class Crate(SourceFetcher):
     def _get_mirror_file(self, sha=None):
         return os.path.join(self._get_mirror_dir(), sha or self.sha)
 
+    # _get_source_info()
+    #
+    # Gets the SourceInfo object for this crate
+    #
+    # Returns: The SourceInfo object
+    #
+    def _get_source_info(self):
+        url, _ = self._get_url()
+        return SourceInfo(
+            url, SourceInfoMedium.REMOTE_FILE, SourceVersionType.SHA256, self.sha, version_guess=self.version
+        )
+
 
 class CargoSource(Source):
     BST_MIN_VERSION = "2.0"
@@ -451,6 +463,9 @@ class CargoSource(Source):
     def get_source_fetchers(self):
         return self.crates
 
+    def collect_source_info(self):
+        return [crate._get_source_info() for crate in self.crates]
+
     ########################################################
     #                   Private helpers                    #
     ########################################################