!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

905 Members
For people hacking on the Nix package manager itself190 Servers

Load older messages


SenderMessageTime
8 Jun 2021
@manveru:matrix.orgmanveru
In file included from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/x86_64-unknown-linux-gnu/bits/c++allocator.h:33,
                 from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/allocator.h:46,
                 from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/memory:64,
                 from src/libutil/ref.hh:3,
                 from src/libstore/s3.hh:5,
                 from src/libstore/s3-binary-cache-store.cc:3:
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = nix::AwsLogger; _Args = {const Aws::Utils::Logging::LogLevel&}; _Tp = nix::AwsLogger]’:
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/alloc_traits.h:512:17:   required from ‘static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up*, _Args&& ...) [with _Up = nix::AwsLogger; _Args = {const Aws::Utils::Logging::LogLevel&}; _Tp = nix::AwsLogger; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<nix::AwsLogger>]’
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/shared_ptr_base.h:551:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {const Aws::Utils::Logging::LogLevel&}; _Tp = nix::AwsLogger; _Alloc = std::allocator<nix::AwsLogger>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/shared_ptr_base.h:682:16:   required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = nix::AwsLogger; _Alloc = std::allocator<nix::AwsLogger>; _Args = {const Aws::Utils::Logging::LogLevel&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/shared_ptr_base.h:1371:71:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<nix::AwsLogger>; _Args = {const Aws::Utils::Logging::LogLevel&}; _Tp = nix::AwsLogger; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/shared_ptr.h:408:59:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<nix::AwsLogger>; _Args = {const Aws::Utils::Logging::LogLevel&}; _Tp = nix::AwsLogger]’
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/shared_ptr.h:859:14:   required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = nix::AwsLogger; _Alloc = std::allocator<nix::AwsLogger>; _Args = {const Aws::Utils::Logging::LogLevel&}]’
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/shared_ptr.h:875:39:   required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = nix::AwsLogger; _Args = {const Aws::Utils::Logging::LogLevel&}]’
src/libstore/s3-binary-cache-store.cc:82:83:   required from here
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/ext/new_allocator.h:150:4: error: invalid new-expression of abstract class type ‘nix::AwsLogger’
  150 |  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libstore/s3-binary-cache-store.cc:52:7: note:   because the following virtual functions are pure within ‘nix::AwsLogger’:
   52 | class AwsLogger : public Aws::Utils::Logging::FormattedLogSystem
      |       ^~~~~~~~~
In file included from /nix/store/pj9f7qgpvw27ri18hdk11bkp24lzqq2a-aws-sdk-cpp-1.8.121-dev/include/aws/core/Aws.h:8,
                 from src/libstore/s3-binary-cache-store.cc:11:
/nix/store/pj9f7qgpvw27ri18hdk11bkp24lzqq2a-aws-sdk-cpp-1.8.121-dev/include/aws/core/utils/logging/LogSystemInterface.h:46:30: note:     ‘virtual void Aws::Utils::Logging::LogSystemInterface::Flush()’
   46 |                 virtual void Flush() = 0;
      |                              ^~~~~
make: *** [mk/patterns.mk:3: src/libstore/s3-binary-cache-store.o] Error 1
08:19:07
@manveru:matrix.orgmanveruanyway, after the fix it doesn't segfault anymore08:20:06
@manveru:matrix.orgmanveru
❮ ./result/bin/nix eval --expr 'builtins.listToAttrs [ (builtins.listToAttrs [ { name = "foo"; value = "bar"; } ])]'
error: attribute 'name' missing for call to 'listToAttrs'

       at «string»:1:1:

            1| builtins.listToAttrs [ (builtins.listToAttrs [ { name = "foo"; value = "bar"; } ])]
             | ^
08:20:09
@manveru:matrix.orgmanveruwill see if that also fixes my original issue :)08:20:36
@manveru:matrix.orgmanveruyep08:22:12
@manveru:matrix.orgmanveru
❮ ~/github/nixos/nix/result/bin/nix build .#nixosConfigurations.alpha.config.system.build.toplevel
warning: Git tree '/home/manveru/nixos-conf' is dirty
error: attribute 'dc=iog' missing for call to 'getAttr'

       at /nix/store/zjmnwn76xzxw3j7v1p98fd0aywpvyylf-source/nixos/modules/services/databases/openldap.nix:281:41:

          280|         mkLoadScript = dn: let
          281|           dataDir = lib.escapeShellArg (getAttr dn dataDirs);
             |                                         ^
          282|         in  ''
(use '--show-trace' to show detailed location information)
08:22:29
@manveru:matrix.orgmanverumuch nicer :)08:22:31
@manveru:matrix.orgmanverunow... how do you write a test for this?08:29:02
@manveru:matrix.orgmanveru it seems like builtins.tryEval doesn't catch this still 08:31:03
@manveru:matrix.orgmanveru builtins.unsafeGetAttrPos "bar" (builtins.listToAttrs [ { name = "foo"; value = "bar"; } ]) returns null in both the fixed and unfixed version... 08:33:00
@theophane:hufschmitt.netRegnat
In reply to @manveru:matrix.org
now... how do you write a test for this?
That’s very good question. I fear the best solution is to grep stderr to ensure that there’s a proper error message and check the return code (should be different between a segfault and a proper exit)
08:37:49
@manveru:matrix.orgmanveruanyway, here's my PR: https://github.com/NixOS/nix/pull/489508:37:46
@manveru:matrix.orgmanveruhm, i see, most other tests are ad-hoc shell scripts as well08:40:00
@manveru:matrix.orgmanveruok, got a working test now as well :)09:03:14
@manveru:matrix.orgmanveruthanks a lot09:03:16
@theophane:hufschmitt.netRegnat niksnut Looking at the GC again, is it correct that Exprs are generally leaking? 17:09:09
@niksnut:matrix.orgniksnutIt's by design17:09:51
@niksnut:matrix.orgniksnutThere is basically no point in GC'ing ASTs17:11:08
@niksnut:matrix.orgniksnutSince they generally exist for the duration of the program17:11:30
@theophane:hufschmitt.netRegnatOh, do they? I kind-of assumed that once a thunk is evaluated, the underlying AST isn’t used anymore (and is unreachable anyways)17:29:18
@theophane:hufschmitt.netRegnatI’ll have to review my understanding of the evaluator then 🤔17:34:01
@niksnut:matrix.orgniksnutAST nodes are shared by all the thunks that refer to them17:46:32
@niksnut:matrix.orgniksnutAnd there is a file cache, so if you import a file twice you get the same AST17:47:00
@niksnut:matrix.orgniksnutBut the most important thing is that AST memory usage is bounded by the set of Nix expressions imported17:48:16
@niksnut:matrix.orgniksnutUnlike values, of which there can be arbitrarily many during an eval17:48:42
@theophane:hufschmitt.netRegnat
In reply to @niksnut:matrix.org
But the most important thing is that AST memory usage is bounded by the set of Nix expressions imported
Ahah, yes, that’s true
18:09:41
@theophane:hufschmitt.netRegnatI wonder though whether there’s something to gain from freeing them at the end of the eval… but given that there’s no clear point where we finish the eval, it probably doesn’t make much sense18:10:54
9 Jun 2021
@matto153:matrix.orgmatto153 joined the room.08:06:21
@matto153:matrix.orgmatto153Hello all08:17:41
@joerg:bethselamin.deMic92 (Old)I assume flakes cannot have git submodules?11:42:14

Show newer messages


Back to Room ListRoom Version: 6