question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add command line tool to Nixpkgs?

See original GitHub issue

Using nixUnstable, I tried installing mach-nix with:

nix registry add mach github:DavHau/mach-nix
nix search mach

And I encountered:

warning: --- Large path ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
dumping very large path (> 256 MiB); this may run out of memory
warning: --- Large path --- nix-daemon
dumping very large path (> 256 MiB); this may run out of memory
[1 copied (75.7 MiB), 150.2/54.5 MiB DL] downloading 'https://github.com/DavHau/nix-pypi-fetcher/tarball/e105186d0101ead100a64e86b1cd62abd1482error: --- EvalError --------------------------------------------------------------------------------------------------------------------- nix
at: (46:24) in file: /nix/store/jndn6xr4zk84wy746qg3kcajf7clg1h0-nix-pypi-fetcher-src/default.nix

    45|   '';
    46|   allNames = fromJSON (readFile allNamesJsonFile);
      |                        ^
    47| in

cannot read '/nix/store/q3v00s260vb7c5b8k95jxbzhhrhjss7r-all-package-names', since path '/nix/store/vpxwskniiixv133r82rhqdj8rk1g096i-all-package-names.drv' is not valid
(use '--show-trace' to show detailed location information)

So I guess https://github.com/DavHau/nix-pypi-fetcher/blob/master/default.nix should be patched, but speaking of the mach-nix tool, which is what I wanted to obtain, would it be a good idea adding it to Nixpkgs? For more casual Nix users?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
doronbeharcommented, Nov 2, 2020
1reaction
doronbeharcommented, Oct 30, 2020

This is also bad:

https://github.com/DavHau/mach-nix/blob/9aa62d0d03587a2fb0accae70e4c036df51b0e13/mach_nix/nix/deps-db-and-fetcher.nix#L8-L19

You have 3 different places where the pypi-fetcher commit is grabbed from. We are lucky we have flakes… Never mind that. Indeed the issue is not about with expr;. I managed to get this diff:

diff --git i/flake.lock w/flake.lock
index 589d55e..fc3a276 100644
--- i/flake.lock
+++ w/flake.lock
@@ -17,11 +17,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1601171649,
-        "narHash": "sha256-G3RUAi2DUq6r3ntASLS+LZC/Eamot55W1+xmBOgEh3M=",
+        "lastModified": 1603758576,
+        "narHash": "sha256-xKFmWVx+rFInBao3gtmvXcd0LjHD1+0c1Ef5PJDrbuM=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "84d74ae9c9cbed73274b8e4e00be14688ffc93fe",
+        "rev": "1dc37370c489b610f8b91d7fdd40633163ffbafd",
         "type": "github"
       },
       "original": {
diff --git i/lib/extractor/default.nix w/lib/extractor/default.nix
index f10a41e..9046f34 100644
--- i/lib/extractor/default.nix
+++ w/lib/extractor/default.nix
@@ -1,11 +1,11 @@
 let
   pkgs = import <nixpkgs> { config = { allowUnfree = true; }; overlays = []; };
-  commit = "1434cc0ee2da462f0c719d3a4c0ab4c87d0931e7";
+  commit = "5798bc0422ca639f2f0ed6fbb22827fc7c8f794c";
   fetchPypiSrc = builtins.fetchTarball {
    name = "nix-pypi-fetcher";
-   url = "https://github.com/DavHau/nix-pypi-fetcher/archive/${commit}.tar.gz";
+   url = "https://github.com/doronbehar/nix-pypi-fetcher/archive/${commit}.tar.gz";
    # Hash obtained using `nix-prefetch-url --unpack <url>`
-   sha256 = "080l189zzwrv75jgr7agvs4hjv4i613j86d4qky154fw5ncp0mnp";
+   sha256 = "1fyj5gdgmd9msfmsfx2r040hjsyncm99d178rsf5kfmgd9kmkvmg";
   };
   fetchPypi = import (fetchPypiSrc);
   patchDistutils = python_env:
diff --git i/mach_nix/nix/deps-db-and-fetcher.nix w/mach_nix/nix/deps-db-and-fetcher.nix
index f9f3875..9bdb057 100644
--- i/mach_nix/nix/deps-db-and-fetcher.nix
+++ w/mach_nix/nix/deps-db-and-fetcher.nix
@@ -10,15 +10,15 @@ let
     url = "https://github.com/DavHau/pypi-deps-db/tarball/${pypi_deps_db_commit}";
     sha256 = "${pypi_deps_db_sha256}";
   };
-  pypi_fetcher_commit = removeSuffix "\n" (readFile "${deps_db_src}/PYPI_FETCHER_COMMIT");
-  pypi_fetcher_sha256 = removeSuffix "\n" (readFile "${deps_db_src}/PYPI_FETCHER_SHA256");
+  pypi_fetcher_commit = "8250decda817133577d401eb38cba78a378dd3af";
+  # pypi_fetcher_sha256 = removeSuffix "\n" (readFile "${deps_db_src}/PYPI_FETCHER_SHA256");
   pypi_fetcher_src = fetchTarball {
-    name = "nix-pypi-fetcher-src";
-    url = "https://github.com/DavHau/nix-pypi-fetcher/tarball/${pypi_fetcher_commit}";
-    sha256 = "${pypi_fetcher_sha256}";
+    name = "nix-pypi-fetcher";
+    url = "https://github.com/doronbehar/nix-pypi-fetcher/archive/${pypi_fetcher_commit}.tar.gz";
   };
   pypi_fetcher = import pypi_fetcher_src {
     inherit pkgs;
+    inherit lib;
   };
 in
 let

And with nix search --impure --update-input nixpkgs . I got the same error as before… I completely misinterpreted the situation.

I suspect that builtins.readFile acts differently upon allNamesJsonFile if it’s created with nixUnstable compared to other Nix (What is your Nix version?)

That json file shouldn’t be a json file - it could be evaluated all in pure Nix, as it seems from that python snippet - buckets could be a Nix variable, and all_names is just builtins.catAttrs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI guideline - NixOS
nix command provides a single entry to a number of sub-commands that help developers and system administrators in the life-cycle of a software...
Read more >
Use proper SDK and command-line tools on OS X 10.11 #9809
nixpkgs should be using the 10.11 SDK on 10.11, just like it uses the 10.9 SDK on 10.9, and 10.10 on 10.10. We...
Read more >
Nix command - NixOS Wiki
This article is about the new nix command and all of its subcommands. The new nix command is intended to unify many different...
Read more >
How to package a command-line tool in Nix? - Stack Overflow
1 Answer 1 ... and can be installed by calling nix-env -f ./default.nix -i from scriptdir . Share.
Read more >
Nix integration - The Haskell Tool Stack
You should either run source ~/.nix-profile/etc/profile.d/nix.sh manually every time you open a terminal and need Nix or add this command to your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found