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

nodejs-21.yaml: Add openssf-options #32820

Conversation

justinvreeland
Copy link
Member

No description provided.

@justinvreeland justinvreeland added automated pr openssf-compiler-options Track adding openssf-compiler-options labels Nov 1, 2024
@justinvreeland justinvreeland requested a review from xnox November 1, 2024 15:36
@xnox xnox added the approved-to-run A repo member has approved this external contribution label Nov 12, 2024
Copy link
Contributor

octo-sts bot commented Nov 12, 2024

Gen AI suggestions to solve the build error:

Based on the error output, this appears to be a C++20 compatibility issue with Node.js v22.11.0's V8 engine code. The compiler is complaining about template-id syntax that's not allowed in C++20. Here are a few potential solutions:

  1. Add a compiler flag to use an earlier C++ standard:
  - name: Configure and build
    runs: |
      # Add C++17 flag to avoid C++20 template-id issues
      export CXXFLAGS="$CXXFLAGS -std=c++17"
      # Rest of your existing configure/build commands...
  1. Add environment variables to control the C++ standard:
environment:
  contents:
    packages:
      # ... existing packages ...
    environment:
      CXXFLAGS: "-std=c++17"
  1. Pass additional configure flags:
      python3 configure.py --prefix=/usr \
        --cxxflags="-std=c++17" \
        # ... rest of your existing configure flags ...

The first option (adding the compiler flag in the build step) is probably the most straightforward solution. This will force the compilation to use C++17 standards which should be compatible with the V8 codebase.

The error occurs because C++20 has stricter rules about template constructor syntax, and the V8 engine's code hasn't been updated to comply with these new rules. Using C++17 will allow the code to compile with the existing syntax.

Try implementing one of these solutions (preferably the first one) and see if it resolves the build error.

@justinvreeland justinvreeland force-pushed the jvreeland/automated-ssf-nodejs-21.yaml branch from c096ab7 to 38e67b1 Compare December 8, 2024 23:48
@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Dec 9, 2024
@justinvreeland justinvreeland marked this pull request as ready for review December 9, 2024 00:07
@mamccorm mamccorm merged commit c4fab79 into wolfi-dev:main Dec 9, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-to-run A repo member has approved this external contribution automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. openssf-compiler-options Track adding openssf-compiler-options
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants