nodejs 26.8.2 fails to build with clang/LLVM
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.3k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 283
Mô tả
Version
26.8.2
Platform
Linux (Gentoo with LLVM profile)
Subsystem
LIEF (or forzen)
What steps will reproduce the bug?
- Build nodejs version 26.8.2 with clang
- 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với deps/LIEF/third-party/frozen/include/frozen/map.h, sau đó tái hiện bản build Node.js 26.8.2 trên Linux bằng Clang. Kiểm tra phần phụ thuộc thư viện chuẩn được báo cáo trong lỗi và xác minh rằng bản build hoàn tất thành công với Clang mà không có các lỗi std::less chưa được định nghĩa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp, linux, nodejs
- Lĩnh vực
- build-system, operating-systems
- Loại issue
- Lỗi
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 88/100