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

python 3.12.5 new added build target _RegenSbom fails to build on windows #123458

Closed
Ganeshkumhar1 opened this issue Aug 29, 2024 · 6 comments
Closed
Assignees
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@Ganeshkumhar1
Copy link

Ganeshkumhar1 commented Aug 29, 2024

Bug report

Bug description:

<Target Name="Regen"
          Condition="$(Configuration) != 'PGUpdate'"
          DependsOnTargets="_TouchRegenSources;_RegenPegen;_RegenAST_H;_RegenOpcodes;_RegenTokens;_RegenKeywords;_RegenGlobalObjects;_RegenSbom">
    <Message Text="Generated sources are up to date" Importance="high" />
  </Target>
FAILURE - 
      _RegenGlobalObjects:
         Regenerate Global Objects
         "C:\Temp\3499797612\python\src\Python-3.12.5\PCbuild\\..\externals\pythonx86\tools\python.exe" Tools\build\generate_global_objects.py
         # not changed: C:\Temp\3499797612\python\src\Python-3.12.5\Include\internal\pycore_global_strings.h
         # not changed: C:\Temp\3499797612\python\src\Python-3.12.5\Include\internal\pycore_runtime_init_generated.h
         # not changed: C:\Temp\3499797612\python\src\Python-3.12.5\Include\internal\pycore_unicodeobject_generated.h
         # not changed: C:\Temp\3499797612\python\src\Python-3.12.5\Include\internal\pycore_global_objects_fini_generated.h
       _RegenSbom:
         "C:\Temp\3499797612\python\src\Python-3.12.5\PCbuild\\..\externals\pythonx86\tools\python.exe" "C:\Temp\3499797612\python\src\Python-3.12.5\Tools\build\generate_sbom.py"
         fatal: not a git repository (or any of the parent directories): .git
         Traceback (most recent call last):
           File "C:\Temp\3499797612\python\src\Python-3.12.5\Tools\build\generate_sbom.py", line 349, in <module>
             main()
           File "C:\Temp\3499797612\python\src\Python-3.12.5\Tools\build\generate_sbom.py", line 344, in main
             create_source_sbom()
           File "C:\Temp\3499797612\python\src\Python-3.12.5\Tools\build\generate_sbom.py", line 245, in create_source_sbom
             paths = filter_gitignored_paths(paths)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           File "C:\Temp\3499797612\python\src\Python-3.12.5\Tools\build\generate_sbom.py", line 124, in filter_gitignored_paths
             assert git_check_ignore_proc.returncode in (0, 1)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         AssertionError
   How I am building - 
   [Python-3.12.5\PCbuild]call build.bat -e -v -p x64 --no-tkinter

I was able to build 3.12.3 successfully using this but 3.12.5 if failing with git error . I am not using git here though it is installed on my windows host. could someone Please suggest a way out here.

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Linked PRs

@Ganeshkumhar1 Ganeshkumhar1 added the type-bug An unexpected behavior, bug, or error label Aug 29, 2024
@picnixz picnixz added OS-windows build The build process and cross-build labels Aug 29, 2024
@zooba
Copy link
Member

zooba commented Aug 29, 2024

@sethmlarson FYI. I doubt this is Windows-specific, unless the SBOM script isn't using Git on other platforms.

As for a workaround, I would hope that if you touch the Misc/*.spdx.json files so their last modified date is recent, they shouldn't try to regenerate. That ought to skip the whole thing. Or you can delete _RegenSbom from that section of regen.targets you posted.

@sethmlarson
Copy link
Contributor

@zooba Yeah this isn't Windows specific, this will happen whenever you pull the source code and try to regenerate without a local .git repository. Let me try to see if we can get .gitignore filtering without needing a git repository?

@zooba
Copy link
Member

zooba commented Aug 29, 2024

Or skip the SBOM update?

@sethmlarson
Copy link
Contributor

Created #123507 which skips the SBOM update if there's no git repository in the source tree.

@hugovk
Copy link
Member

hugovk commented Sep 2, 2024

@hugovk hugovk reopened this Sep 2, 2024
Yhg1s pushed a commit that referenced this issue Sep 2, 2024
…ed (GH-123507) (#123616)

gh-123458: Skip SBOM generation if no git repository is detected (GH-123507)
(cherry picked from commit db42934)

Co-authored-by: Seth Michael Larson <[email protected]>
Yhg1s pushed a commit that referenced this issue Sep 2, 2024
…ed (GH-123507) (#123615)

gh-123458: Skip SBOM generation if no git repository is detected (GH-123507)
(cherry picked from commit db42934)

Co-authored-by: Seth Michael Larson <[email protected]>
@hugovk
Copy link
Member

hugovk commented Sep 3, 2024

Backports merged, thanks all.

@hugovk hugovk closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

6 participants
@hugovk @zooba @picnixz @Ganeshkumhar1 @sethmlarson and others