From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 19:06:45 2022 Received: (at submit) by debbugs.gnu.org; 20 Nov 2022 00:06:45 +0000 Received: from localhost ([127.0.0.1]:41748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owXrA-0007Ar-T4 for submit@debbugs.gnu.org; Sat, 19 Nov 2022 19:06:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:37572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owXr6-0007Ad-53 for submit@debbugs.gnu.org; Sat, 19 Nov 2022 19:06:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owXr5-0007up-FC for bug-guix@gnu.org; Sat, 19 Nov 2022 19:06:40 -0500 Received: from mta-06-3.privateemail.com ([198.54.127.59]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owXr3-0004w7-9Y for bug-guix@gnu.org; Sat, 19 Nov 2022 19:06:39 -0500 Received: from mta-06.privateemail.com (localhost [127.0.0.1]) by mta-06.privateemail.com (Postfix) with ESMTP id D728018000B8 for ; Sat, 19 Nov 2022 19:06:26 -0500 (EST) Received: from [192.168.1.8] (pool-71-105-205-179.nycmny.fios.verizon.net [71.105.205.179]) by mta-06.privateemail.com (Postfix) with ESMTPA id 0DBEF18000A0 for ; Sat, 19 Nov 2022 19:06:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quic.us; s=default; t=1668902786; bh=Io81OxQoG8I+icrXLNlz5RLr3acBZQUEh+dOy20VU2I=; h=Date:To:From:Subject:From; b=JREUqNC0hljN6/t8j2mvLG94rgG8orkhp3MaRgtyMur6+SHcMbOjIKKhpydFGpt3B oF934yqtwUorkrsXJJBzDD086SJZmJ9XhWcwRWXTA2lx6NovdZlmzrbzzWPgA8b0SE wFiZvFva2vXsz/q72Q0KAF2p3r1omOjL3/0m12KdiedMhlWj4WZbUDM7DcYZlJ4mbD GPerq5MUzmP3qnip3suNRlMUiwt/5LDYnb3j8jy8M7PGG5AcpHewL8QSP+sYDes3eM 2gl/rfqlOBvmSphSiGVGxg93IACTRc3v7mm/P08UlCrCTj5Xmz0lj2gKbv5qYHeuCg AIsYlme/iLhfA== Message-ID: <381e762e-5a44-a746-b3c9-1a680d7ec260@quic.us> Date: Sat, 19 Nov 2022 19:06:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: bug-guix@gnu.org From: Abhishek Cherath Subject: [node] node-gyp dependent packages may not work correctly due to node-lts ld.so.cache Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass client-ip=198.54.127.59; envelope-from=abhi@quic.us; helo=MTA-06-3.privateemail.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, This is a fairly involved bug report, the basic idea is that several npm packages depend on [node-gyp](https://www.npmjs.com/package/node-gyp), which is a build tool (written in python) that compiles native plugins for nodejs (so generally C/C++ code). This tool uses the *system* C/C++ compiler, so on a guix system with gcc-toolchain, that would be gcc-12. this allows for the compilation and installation of these packages in node_modules fine. However, at runtime (which happens as `node program.js`) since the dynamic linker looks in the node-lts package's ld.so.cache, it tries to link against gcc-10's libstdc++.so.6, and errors out because of missing symbols. To Reproduce, attempt the following (this isn't a particularly minimal example) 1. guix shell --pure gcc-toolchain libuv mesa make python2 pkg-config libx11 libxext libxi node 2. cd <> 3. CC=gcc npm i gl 4. guix shell gcc-toolchain libuv mesa make python2 pkg-config libx11 libxext libxi node 5. echo "var gl = require('gl')(64, 64, { preserveDrawingBuffer: true })" > test.js 6. node test.js observe "ERR_DLOPEN_FAILED", with Error: /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found running with LD_DEBUG=all, shows that node-14.19.3's linked gcc's libstdc++ is used: 3608: find library=libstdc++.so.6 [0]; searching 3608: search cache=/gnu/store/mgxvqphymkf1xfz4zryppr1jwnd5xcyw-node-14.19.3/etc/ld.so.cache 3608: trying file=/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6 I'm not really certain how one would go about solving this tbh, I'm planning to look a little deeper into how node-gyp decides what C++ compiler to use, might be a matter of setting some env vars or something? any ideas are appreciated. Thank you, Abhishek.