nodejs / nodejs/node

nodejs 26.8.2 fails to build with clang/LLVM

Ouverte Adaptée aux débutants
#66,076 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

build
Langage dominant
JavaScript
Étoiles
122k
Forks
37.3k
Merge moyen
4 j 2 h
PR mergées (30 j)
283

Description

Version

26.8.2

Platform
Linux (Gentoo with LLVM profile)
Subsystem

LIEF (or forzen)

What steps will reproduce the bug?
  1. Build nodejs version 26.8.2 with clang
  2. Observe failure
How often does it reproduce? Is there a required condition?

Always while building with clang

What is the expected behavior? Why is that the expected behavior?

Successful build with clang

What do you see instead?

Build failure while building with Clang

A snippet from the build log:

...
In file included from ../../deps/LIEF/src/platforms/android/version.cpp:17:
In file included from ../../deps/LIEF/src/frozen.hpp:22:
../../deps/LIEF/third-party/frozen/include/frozen/map.h:40:20: error: implicit instantiation of undefined template 'std::less<LIEF::Android::ANDROID_VERSIONS>'
   40 |   Comparator const comparator_;
      |                    ^
../../deps/LIEF/third-party/frozen/include/frozen/map.h:75:29: note: in instantiation of template class 'frozen::impl::CompareKey<std::less<LIEF::Android::ANDROID_VERSIONS>>' requested here
   75 |   impl::CompareKey<Compare> less_than_;
      |                             ^
../../deps/LIEF/src/platforms/android/version.cpp:22:47: note: in instantiation of template class 'frozen::map<LIEF::Android::ANDROID_VERSIONS, const char *, 8>' requested here
   22 |   CONST_MAP(ANDROID_VERSIONS, const char*, 8) version2code {
      |                                               ^
/usr/include/c++/v1/__fwd/functional.h:25:8: note: template is declared here
   25 | struct less;
      |        ^
In file included from ../../deps/LIEF/src/platforms/android/version.cpp:17:
In file included from ../../deps/LIEF/src/frozen.hpp:22:
../../deps/LIEF/third-party/frozen/include/frozen/map.h:110:20: error: implicit instantiation of undefined template 'std::less<LIEF::Android::ANDROID_VERSIONS>'
  110 |       : map{items, Compare{}} {}
      |                    ^
../../deps/LIEF/src/platforms/android/version.cpp:22:47: note: in instantiation of member function 'frozen::map<LIEF::Android::ANDROID_VERSIONS, const char *, 8>::map' requested here
   22 |   CONST_MAP(ANDROID_VERSIONS, const char*, 8) version2code {
      |                                               ^
/usr/include/c++/v1/__fwd/functional.h:25:8: note: template is declared here
   25 | struct less;
      |        ^
../../deps/LIEF/src/platforms/android/version.cpp:22:47: error: constexpr variable 'version2code' must be initialized by a constant expression
   22 |   CONST_MAP(ANDROID_VERSIONS, const char*, 8) version2code {
...
Additional information

I think this is due to stricter include requirements on clang
I was able to build by adding #include <functional> in deps/LIEF/third-party/frozen/include/frozen/map.h

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par deps/LIEF/third-party/frozen/include/frozen/map.h, puis reproduisez le build de Node.js 26.8.2 sous Linux avec Clang. Vérifiez la dépendance à la bibliothèque standard indiquée dans l’erreur et confirmez que le build se termine correctement avec Clang sans les erreurs liées à std::less non défini.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
cpp, linux, nodejs
Domaine
build-system, operating-systems
Type d'issue
Bug
Difficulté
1/5
Temps estimé
Moins d'une heure
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
88/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.