From 5eea75607435e2d68cfa5b4d86c4919ee505ecb0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 8 Apr 2023 07:52:26 +0100 Subject: [PATCH] nodejs: explicitly disable __contentAddressed Without the change attempt to enable content addressing on nodejs breaks the `nodejs` binary: $ nix build -f. nodejs --arg config '{ contentAddressedByDefault = true; }' $ LANG=C ./result/bin/node # # Fatal error in , line 0 # Check failed: VerifyChecksum(blob). # # # #FailureMessage Object: 0x7ffce2820790 1: 0xb2a2c5 [./result/bin/node] 2: 0x1866d9a V8_Fatal(char const*, ...) [./result/bin/node] 3: 0x12d7473 v8::internal::Snapshot::Initialize(v8::internal::Isolate*) [./result/bin/node] 4: 0xce85e6 v8::Isolate::Initialize(v8::Isolate*, v8::Isolate::CreateParams const&) [./result/bin/node] 5: 0x9e0614 node::NewIsolate(v8::Isolate::CreateParams*, uv_loop_s*, node::MultiIsolatePlatform*, bool) [./result/bin/node] 6: 0xafdcb2 node::NodeMainInstance::NodeMainInstance(node::SnapshotData const*, uv_loop_s*, node::MultiIsolatePlatform*, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, std::vector, std::allocator >, std::allocator, std::allocator > > > const&) [./result/bin/node] 7: 0xa670a3 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [./result/bin/node] 8: 0xa6ac9c node::Start(int, char**) [./result/bin/node] 9: 0x7f2b7002924e [/nix/store/h9w6fix9k2lrbc05p4a6inw2r9sywlb1-glibc-2.35-224/lib/libc.so.6] 10: 0x7f2b70029309 __libc_start_main [/nix/store/h9w6fix9k2lrbc05p4a6inw2r9sywlb1-glibc-2.35-224/lib/libc.so.6] 11: 0x9da7f5 _start [./result/bin/node] Trace/breakpoint trap (core dumped) Let's override the default by always disable content addressing. --- pkgs/development/web/nodejs/nodejs.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 18edea1ab65b..52283d89bddf 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -96,6 +96,14 @@ let enableParallelBuilding = true; + # Don't allow enabling content addressed conversion as `nodejs` + # checksums it's image before conversion happens and image loading + # breaks: + # $ nix build -f. nodejs --arg config '{ contentAddressedByDefault = true; }' + # $ ./result/bin/node + # Check failed: VerifyChecksum(blob). + __contentAddressed = false; + passthru.interpreterName = "nodejs"; passthru.pkgs = callPackage ../../node-packages/default.nix {