makes icon indicating copy to clipboard operation
makes copied to clipboard

Update nixpkgs

Open kamadorueda opened this issue 4 years ago • 2 comments

I'm finding some trouble updating nixpkgs, seems they have changed something at the core of the build hooks

Let's inspect

kamadorueda avatar Oct 12 '21 02:10 kamadorueda

We can't upgrade to master as there are too much python39 broken packages. Additionally rpl is not self-contained, so it does not bootstrap its dependencies making it fail at runtime.

Leaving the hacks I performed for being able to upgrade:

diff --git a/src/args/make-template/builder.sh b/src/args/make-template/builder.sh
index 1cea429..494ac7b 100644
--- a/src/args/make-template/builder.sh
+++ b/src/args/make-template/builder.sh
@@ -1,6 +1,12 @@
 # shellcheck shell=bash
 
+# This is a small compatibility layer for being able to bootstrap
+# a few required nixpkgs packages
+# export buildInputs="${__envNixpkgsBuildInputs}"
+# export initialPath="${__envNixpkgsInitialPath}"
+# source "${__envNixpkgsSrc}/pkgs/stdenv/generic/setup.sh"
 export PATH="${__envPath}:${PATH:-}"
+export PYTHONPATH="${__envPythonPath}"
 
 function replace_arg_in_file {
   local file="${1}"
diff --git a/src/args/make-template/default.nix b/src/args/make-template/default.nix
index 85e6de8..571c3fb 100644
--- a/src/args/make-template/default.nix
+++ b/src/args/make-template/default.nix
@@ -1,4 +1,5 @@
 { __nixpkgs__
+, __nixpkgsSrc__
 , asContent
 , toFileLst
 , makeDerivation
@@ -47,10 +48,25 @@ makeDerivation {
       (builtins.attrNames replace);
     __envArgumentBase64NamesFile = toFileLst "replaceBase64.lst"
       (builtins.attrNames replaceBase64);
-    __envPath = __nixpkgs__.lib.strings.makeBinPath [
-      __nixpkgs__.gnugrep
-      __nixpkgs__.rpl
-    ];
+
+    __envPath = __nixpkgs__.lib.strings.makeSearchPath
+      "bin"
+      [ __nixpkgs__.gnugrep __nixpkgs__.rpl ];
+    # TODO: Patch rpl at Nixpkgs so it is self-contained?
+    # TODO: i.e. Make `rpl` (a python app)  bootstrap `chardet` (a python lib)
+    # TODO: so we don't need to do this uglyness
+    __envPythonPath = __nixpkgs__.lib.strings.makeSearchPath
+      "lib/python3.8/site-packages"
+      [ __nixpkgs__.python38Packages.chardet ];
+
+    # __envNixpkgsSrc = __nixpkgsSrc__;
+    # __envNixpkgsBuildInputs = [
+    #   __nixpkgs__.gnugrep
+    #   __nixpkgs__.python3Packages.chardet
+    #   __nixpkgs__.rpl
+    # ];
+    # __envNixpkgsInitialPath = [ __nixpkgs__.coreutils ];
+
     __envTemplate =
       if searchPaths == { }
       then asContent template
diff --git a/src/nix/sources.json b/src/nix/sources.json
index 6b6bd32..106aac6 100644
--- a/src/nix/sources.json
+++ b/src/nix/sources.json
@@ -5,10 +5,10 @@
         "homepage": "",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "fcbbb82ffd63a58c1891c1c1d61dab21b542eb30",
-        "sha256": "0acr7qbvi4ly02ajn3apmndnlb7jg78wmxl2mzqgwz94qssdawql",
+        "rev": "73afb8e8a1d4778e664d1280463448745aca0668",
+        "sha256": "16cfqlaf562nmq4dswf3f14rfsjd6piz6drm98m1d4szq8whn9fs",
         "type": "tarball",
-        "url": "https://github.com/NixOS/nixpkgs/archive/fcbbb82ffd63a58c1891c1c1d61dab21b542eb30.tar.gz",
+        "url": "https://github.com/NixOS/nixpkgs/archive/73afb8e8a1d4778e664d1280463448745aca0668.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     }
 }

and the errror I got:

image

I suppose we'll wait until things stabilize a little bit over there. I've heard they are already aware of these failures about deprecation warnings

kamadorueda avatar Oct 12 '21 03:10 kamadorueda

Related: https://github.com/fluidattacks/makes/issues/739

kamadorueda avatar Oct 12 '21 15:10 kamadorueda