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 SBOM Compiler Information Into Specific Fields For Windows/Mac #3606

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

steelhead31
Copy link
Contributor

Fixes #3503

Add specific fields into the SBOM for Windows & MacOS compiler versions.

Examples taken from the SBOMs generated with these changes.

Adds This For Windows

    "tools" : [
      {
        "name" : "MS Windows Compiler",
        "version" : "microsoft (Microsoft Visual Studio 2019)"
      },
      {

Adds This For Mac

"tools" : [
   {
     "name" : "MacOS Compiler",
     "version" : "clang (clang/LLVM from Xcode 15.0.1)"
   },

Add code to add specific sections for Mac & Windows compilers to SBOM
@steelhead31 steelhead31 changed the title Add SBOM Compiler Info Add SBOM Compiler Information Into Specific Fields For Windows/Mac Jan 10, 2024
@steelhead31 steelhead31 marked this pull request as draft January 10, 2024 12:40
@steelhead31 steelhead31 marked this pull request as ready for review January 10, 2024 13:23
Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

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

Yep I think I'm happy with this based on the output - can you paste in a full SBoM on each of the two platforms to see it in context? We should also adjust the SBoM content validation in the tooling directory to check this (ideally in this PR but could be a subsequent one)

@steelhead31
Copy link
Contributor Author

steelhead31 commented Jan 10, 2024

@steelhead31
Copy link
Contributor Author

Yep I think I'm happy with this based on the output - can you paste in a full SBoM on each of the two platforms to see it in context? We should also adjust the SBoM content validation in the tooling directory to check this (ideally in this PR but could be a subsequent one)

I'll move this to draft, and implement the changes to validateSBOMContent.sh too, be useful to do that at the same time as this I feel.

@steelhead31 steelhead31 marked this pull request as draft January 10, 2024 14:30
@sxa
Copy link
Member

sxa commented Jan 10, 2024

@steelhead31 @Haroon-Khel I couple of further comments:

  • It would be nice to get this in for the January release next week if we can, for consistency and being able to tell a good story in the next few months :-) So we may wish to cherry pick this across to the release branch when it's in. Based on that, if we can't get the additional checks ready today then perhaps we should just get it merged?
  • I note that this is only saying VS2019, where we have lines like 12:52:44 configure: Using microsoft C compiler version 19.29.30146 [Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30146 for x64] in the log. For the purposes of having the ability to rebuild in a binary identical way from an SBoM perhaps we should try and incorporate the full MS build ID too, but I wouldn't block this PR based on that on a "something is better than nothing" basis. WDYT @andrew-m-leonard ?

@steelhead31 steelhead31 marked this pull request as ready for review January 10, 2024 15:35
@steelhead31 steelhead31 marked this pull request as draft January 10, 2024 16:16
Copy link
Contributor

@andrew-m-leonard andrew-m-leonard left a comment

Choose a reason for hiding this comment

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

lgtm

@steelhead31
Copy link
Contributor Author

@sxa @andrew-m-leonard

Here is an example of the additional MSVS compiler fields in the SBOM ( from a local build currently )

    "timestamp" : "2024-01-10T21:08:16Z",
    "tools" : [
      {
        "name" : "MSVS Windows Compiler Version",
        "version" : "microsoft (Microsoft Visual Studio 2019)"
      },
      {
        "name" : "MSVS C Compiler Version",
        "version" : "19.29.30146"
      },
      {
        "name" : "MSVS C++ Compiler Version",
        "version" : "19.29.30146"
      },

Actual SBOM from build : https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk17u/job/jdk17u-windows-x64-temurin/446/artifact/workspace/target/OpenJDK17U-sbom_x64_windows_hotspot_2024-01-10-23-04.json

@steelhead31 steelhead31 marked this pull request as ready for review January 11, 2024 07:57
@steelhead31 steelhead31 merged commit ec7fb8d into adoptium:master Jan 11, 2024
18 of 23 checks passed
@steelhead31 steelhead31 deleted the sbom_compilers branch January 11, 2024 09:59
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.

Windows & Mac compiler version in SBOM not in a unique field
4 participants