From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: bug#32339: Nix import Date: Tue, 18 Jun 2019 18:09:22 +0200 Message-ID: <20190618160922.GA20229@jurong> References: <20180731200033.pmglhnj7fyiw245n@abyayala> <20190618133216.GA17404@jurong> <20190618141435.GA19464@jurong> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47687) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdGgO-0006GO-Ft for bug-guix@gnu.org; Tue, 18 Jun 2019 12:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdGgM-0004BQ-VC for bug-guix@gnu.org; Tue, 18 Jun 2019 12:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdGgM-0004Ar-RA for bug-guix@gnu.org; Tue, 18 Jun 2019 12:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdGgM-0004VU-IE for bug-guix@gnu.org; Tue, 18 Jun 2019 12:10:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <20190618141435.GA19464@jurong> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 32339@debbugs.gnu.org So, I just discussed with a Nix expert, Profpatsch. Apparently something changed in nixpkgs a while ago, so that the following code does not work any more: $ export NIX_REMOTE=daemon $ nix-instantiate --eval --strict -A hello nixpkgs/ trace: `types.list` is deprecated; use `types.listOf` instead trace: types.optionSet is deprecated; use types.submodule instead trace: Warning: `showVal` is deprecated and will be removed in the next release, please use `traceSeqN` trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead! trace: lib.zip is deprecated, use lib.zipAttrsWith instead trace: `mkStrict' is obsolete; use `mkOverride 0' instead. trace: warning: `stdenv.isArm` is deprecated after 18.03. Please use `stdenv.isAarch32` instead trace: warning: `stdenv.isArm` is deprecated after 18.03. Please use `stdenv.isAarch32` instead trace: warning: `stdenv.isArm` is deprecated after 18.03. Please use `stdenv.isAarch32` instead trace: warning: `stdenv.isArm` is deprecated after 18.03. Please use `stdenv.isAarch32` instead error: overrideDerivation not yet supported for functors (use '--show-trace' to show detailed location information) We should have checked the return value... Omitting the "--strict" flag is not a solution, since then lazy evaluation leads to most interesting fields of the result being empty (the return string value is ""). A potential solution is evaluating for different package fields separately, but this would require more or less a complete rewrite of the importer. I wonder if the solution would not be to drop it completely... Interestingly enough, the programmatic nature of Nix makes it much more difficult to import packages, since we cannot simply use the abstract syntax tree of the textual representation of a package. Here are a few possible commands to run: $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; singular.version" "4.1.1p2" $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; map (drv: drv.name) singular.buildInputs" [ "gmp-6.1.2" "ncurses-6.1-20190112" "readline-6.3p08" "ntl-11.3.2" "flint-2.5.2" "cddlib-0.94j" ] $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; map (drv: drv.name) singular.nativeBuildInputs" [ "bison-3.3.2" "perl-5.28.2" "pkg-config-0.29.2" "hook" ] (notice that there is now a difference between build and native build inputs, and even more types) $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; singular.src" [error message] $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; (singular.override { fetchurl = lib.id; }).src" { sha256 = "07x9kri8vl4galik7lr6pscq3c51n8570pyw64i7gbj0m706f7wf"; url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/4-1-1/singular-4.1.1p2.tar.gz"; } $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; (linbox.override { fetchurl = lib.id; }).src" [error message] $ nix-instantiate --eval --strict -E "with import $PATH_TO_NIXPKGS {}; (linbox.override { fetchFromGitHub = lib.id; }).src" { owner = "linbox-team"; repo = "linbox"; rev = "v1.6.3"; sha256 = "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"; } So for the latter two cases, one would need to try both and catch errors. Andreas