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::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > 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.
This commit is contained in:
Sergei Trofimovich 2023-04-08 07:52:26 +01:00
parent 2e7d54cfde
commit 5eea756074

View File

@ -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 {