代码之家  ›  专栏  ›  技术社区  ›  mherzl

为什么nixos rebuild switch要为未使用的东西创建存储?

  •  0
  • mherzl  · 技术社区  · 6 年前

    nixos-18.09 nixos-unstable 然后又回来了,现在遇到了一个问题 $ nixos-rebuild switch 无法成功运行。

    当我尝试执行此操作时,会出现以下错误:

    writing manifest file 'singledispatch.egg-info/SOURCES.txt'
    Copying singledispatch.egg-info to build/bdist.linux-x86_64/wheel/singledispatch-3.4.0.3-py3.6.egg-info
    running install_scripts
    Traceback (most recent call last):
      File "nix_run_setup", line 8, in <module>
        exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
      File "setup.py", line 20, in <module>
        long_description = f.read()
      File "/nix/store/qbyckcddc74s2fi060n8xqcn8gygrhjl-python3-3.6.8/lib/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 898: ordinal not in range(128)
    builder for '/nix/store/mcncvdwadrq1335bwy279dg7q0sxhvhp-python3.6-rsa-4.0.drv' failed with exit code 1
    cannot build derivation '/nix/store/pifmbmqallj7jkl3ar1wv8nqyfzq08hr-python3.6-python-jose-3.0.1.drv': 1 dependencies couldn't be built
    building '/nix/store/1qy7ka8c0s3mjv51pdiyyp103d11awkb-python3.6-termstyle-0.1.11.drv'...
    building '/nix/store/8zvlx7367p21vj0iccsvhpz1jv3wx0b6-python3.6-websocket_client-0.54.0.drv'...
    cannot build derivation '/nix/store/3w08jzilgvddzx728nnkpaadc7sd9p2v-python3.6-moto-1.3.7.drv': 1 dependencies couldn't be built
    building '/nix/store/qfkfr913dx4ssp1qahfd9wcj6csf6yxm-python3.6-xlrd-1.1.0.drv'...
    building '/nix/store/dvi6y2zlc4gwli0qqhxhr6cbvfs5qwhx-python3.6-xlwt-1.3.0.drv'...
    building '/nix/store/p38p279r5y8bh7n9pvw8194k9zvnybic-reload-container.drv'...
    cannot build derivation '/nix/store/sf4d3zrds99sq22s096f4pdwb2602mf2-python3.6-pandas-0.23.4.drv': 1 dependencies couldn't be built
    building '/nix/store/hy1197qj5ivb54wicyn0ljdbv8qxp0zc-remove-references-to.drv'...
    building '/nix/store/6cqp8vf151gvxbnz03qp4sj9awd8lnfc-smb-dummy.conf.drv'...
    building '/nix/store/cb5r8y9llx4yw64kyg2hhwds4g123h29-stage-1-init.sh.drv'...
    building '/nix/store/4ps1704mhdqj5bp1ck7sa2x67l7h08x4-su.pam.drv'...
    cannot build derivation '/nix/store/hx05mqxryfl1aqvc5lqf0q05n230qnz3-system-path.drv': 1 dependencies couldn't be built
    building '/nix/store/zrrbcfif92d7yz1d4vlcnva3gx8npc2k-systemd-boot-builder.py.drv'...
    building '/nix/store/z8mld3scs2hzb6k3hffjqvfyrg9qnlg7-systemd-user.pam.drv'...
    building '/nix/store/0gixkqfsr3plwcyf72izycpkr5rf1r6k-udev-rules.drv'...
    cannot build derivation '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv': 1 dependencies couldn't be built
    error: build of '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv' failed
    

    $ nix-store --delete /nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv
    

    根据定义,该路径没有“参考者”

    $ nix-store -q --referrers /nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv`)
    

    我还使用 $ nix-store --gc . 然而,运行 $nixos重建交换机 仍然会重新创建此路径,并再次出现相同的错误。

    为什么 创建此路径,如何使该命令再次成功运行?

    我不知道为什么 nixos-system-nixos-19.03 存在于我的系统中;在这一点上,我只是在跟踪 频道:

    $ nixos-channel --list
    nixos-18.09 https://nixos.org/channels/nixos-18.09
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Charles Duffy    6 年前

    如果您仔细查看错误消息,就会非常清楚事件链:

    builder for '/nix/store/mcncvdwadrq1335bwy279dg7q0sxhvhp-python3.6-rsa-4.0.drv' failed with exit code 1
    cannot build derivation '/nix/store/pifmbmqallj7jkl3ar1wv8nqyfzq08hr-python3.6-python-jose-3.0.1.drv': 1 dependencies couldn't be built
    cannot build derivation '/nix/store/3w08jzilgvddzx728nnkpaadc7sd9p2v-python3.6-moto-1.3.7.drv': 1 dependencies couldn't be built
    cannot build derivation '/nix/store/sf4d3zrds99sq22s096f4pdwb2602mf2-python3.6-pandas-0.23.4.drv': 1 dependencies couldn't be built
    cannot build derivation '/nix/store/hx05mqxryfl1aqvc5lqf0q05n230qnz3-system-path.drv': 1 dependencies couldn't be built
    cannot build derivation '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv': 1 dependencies couldn't be built
    error: build of '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv' failed
    

    因此,Python的构建 rsa

    我们为什么要依赖 rsa ? 因为


    顺便说一句,虽然nixpkgs不稳定就是这种情况,但18.09版本(最新发布版本,截至本答案发布之日)没有这种依赖性 在…上 ,因此没有显示手头的问题。我可以建议改用它吗?