Revert "nodejs_18: fix build with clang 16 mk2"

libc++ 19 no longer supports Clang < 17.

This reverts commit b034e4cbf1.
This commit is contained in:
Emily
2024-11-20 02:33:34 +00:00
parent 5cb1de1b5d
commit 42ef3589e6
+1 -12
View File
@@ -1,19 +1,8 @@
{ callPackage, lib, overrideCC, pkgs, buildPackages, openssl, python311, fetchpatch2, enableNpm ? true }:
{ callPackage, lib, openssl, python311, fetchpatch2, enableNpm ? true }:
let
# Clang 16+ cannot build Node v18 due to -Wenum-constexpr-conversion errors.
# Use an older version of clang with the current libc++ for compatibility (e.g., with icu).
ensureCompatibleCC = packages:
if packages.stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion packages.stdenv.cc.cc) "16"
then overrideCC packages.llvmPackages_15.stdenv (packages.llvmPackages_15.stdenv.cc.override {
inherit (packages.llvmPackages) libcxx;
})
else packages.stdenv;
buildNodejs = callPackage ./nodejs.nix {
inherit openssl;
stdenv = ensureCompatibleCC pkgs;
buildPackages = buildPackages // { stdenv = ensureCompatibleCC buildPackages; };
python = python311;
};