unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: 32339@debbugs.gnu.org
Subject: bug#32339: Nix import
Date: Tue, 18 Jun 2019 18:09:22 +0200	[thread overview]
Message-ID: <20190618160922.GA20229@jurong> (raw)
In-Reply-To: <20190618141435.GA19464@jurong>

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 "<CODE>").

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

  reply	other threads:[~2019-06-18 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 20:00 bug#32339: "nix import" fails Nils Gillmann
2019-06-18 13:32 ` bug#32339: Nix import Andreas Enge
2019-06-18 14:14   ` Andreas Enge
2019-06-18 16:09     ` Andreas Enge [this message]
2019-06-21 15:06       ` Ludovic Courtès
2021-04-20 10:41         ` bug#32339: "nix import" fails Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190618160922.GA20229@jurong \
    --to=andreas@enge.fr \
    --cc=32339@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).