berberman / nvfetcher

Generate nix sources expr for the latest version of packages
https://nvfetcher.torus.icu
MIT License
168 stars 14 forks source link

Failure when `cargo_locks` is used with `allow-import-from-derivation` disabled #76

Closed oxalica closed 1 year ago

oxalica commented 2 years ago

I have allow-import-from-derivation = false in my global nix.conf. The following nvfetcher.toml fails when running nvfetcher.

[rawmv]
src.github_tag = "oxalica/rawmv"
fetch.github = "oxalica/rawmv"
cargo_locks = ["Cargo.lock"]

Error log:

error: cannot build '/nix/store/17j9a5ajfb3fsvj12ls958qxb9h52ylk-src.drv' during evaluation because the option 'allow-import-from-derivation' is disabled
(use '--show-trace' to show detailed location information)
error: cannot build '/nix/store/17j9a5ajfb3fsvj12ls958qxb9h52ylk-src.drv' during evaluation because the option 'allow-import-from-derivation' is disabled
(use '--show-trace' to show detailed location information)
error: cannot build '/nix/store/17j9a5ajfb3fsvj12ls958qxb9h52ylk-src.drv' during evaluation because the option 'allow-import-from-derivation' is disabled
(use '--show-trace' to show detailed location information)
Traceback (most recent call last):
  File "/nix/store/wva3vibqf7s0zb95rgb2ijz0sqzkr4s6-python3.10-nvchecker-2.9/bin/.nvchecker-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/wva3vibqf7s0zb95rgb2ijz0sqzkr4s6-python3.10-nvchecker-2.9/lib/python3.10/site-packages/nvchecker/__main__.py", line 83, in main
    newvers, has_failures = asyncio.run(run(result_coro, runner_coro))
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete
    self.run_forever()
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_events.py", line 600, in run_forever
    self._run_once()
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_events.py", line 1860, in _run_once
    event_list = self._selector.select(timeout)
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x7ff948490280>
Traceback (most recent call last):
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_subprocess.py", line 126, in __del__
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_subprocess.py", line 104, in close
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/unix_events.py", line 546, in close
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/unix_events.py", line 570, in _close
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_events.py", line 750, in call_soon
  File "/nix/store/sz0j8k8ljh7y8qgyfxgqb3ws11bcy4gs-python3-3.10.6/lib/python3.10/asyncio/base_events.py", line 515, in _check_closed
RuntimeError: Event loop is closed
nvfetcher: Error when running Shake build system:
  at want, called at src/NvFetcher.hs:158:25 in nvfetcher-0.5.0.0-IbtYycwdc8ACYnQpnhpAYl:NvFetcher
* Depends on: build
* Depends on: Core ("rawmv")
  at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.19.6-F38HdmFGRdGJS34u5zpT58:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ExtractSrcQ (FetchGitHub {_fowner = "oxalica", _frepo = "rawmv", _rev = "v0.2.0", _deepClone = False, _fetchSubmodules = False, _leaveDotGit = False, _name = Nothing, _sha256 = "sha256-cH6NahMzifs5OOSE0nBY4kDr+xPtqcOuVghP/g5JTsc="}) ("Cargo.lock" :| []))
  at cmd, called at src/NvFetcher/ExtractSrc.hs:52:57 in nvfetcher-0.5.0.0-IbtYycwdc8ACYnQpnhpAYl:NvFetcher.ExtractSrc
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: /bin/sh -c 'nix-instantiate --eval --strict --json --read-write-mode -E '\''let pkgs = import <nixpkgs> { }; in ((import /tmp/extra-file-75641469349581-1534839-9) pkgs)'\'''
Original command line: nix-instantiate --eval --strict --json --read-write-mode -E 'let pkgs = import <nixpkgs> { }; in ((import /tmp/extra-file-75641469349581-1534839-9) pkgs)'
Exit code: 1
Stderr:
error: cannot build '/nix/store/17j9a5ajfb3fsvj12ls958qxb9h52ylk-src.drv' during evaluation because the option 'allow-import-from-derivation' is disabled
(use '--show-trace' to show detailed location information)

Seems IFDs are used during fetching? IMO, that should be not necessary, right?