Skip to content

Conversation

mihem
Copy link
Contributor

@mihem mihem commented Jan 18, 2025

Despite my previous PR #385, there is still an issue with double package entires:

rix(
  r_ver = "4.4.1",
  r_pkgs = NULL,
  system_pkgs = NULL,
  git_pkgs = list(
    package_name = "seurat-wrappers",
    repo_url = "https://github.com/satijalab/seurat-wrappers",
    commit = "5b63c23b211002611b0ccc33da009237d0dbafb6"
  ),
  ide = "other",
  project_path = ".",
  overwrite = TRUE,
  print = TRUE
)

leads to seurat-data appearing twice

    schex = (pkgs.rPackages.buildRPackage {
      name = "schex";
      src = pkgs.fetchgit {
        url = "https://github.com/SaskiaFreytag/schex";
        rev = "031320d";
        sha256 = "sha256-fd46ZxXEEk2XsEhQExrvpx+l5GPwGSrzBLTrJQIUVvg=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          SingleCellExperiment
          Seurat
          ggplot2
          hexbin
          scater
          cluster
          dplyr;
      };
    });


    seurat-data = (pkgs.rPackages.buildRPackage {
      name = "seurat-data";
      src = pkgs.fetchgit {
        url = "https://github.com/satijalab/seurat-data";
        rev = "HEAD";
        sha256 = "sha256-dyv8ttrVaGwd5tPle2+wDHMa8lVjozZnVMsKArEMTPE=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          cli
          crayon
          rappdirs
          SeuratObject;
      };
    });


    seurat-data = (pkgs.rPackages.buildRPackage {
      name = "seurat-data";
      src = pkgs.fetchgit {
        url = "https://github.com/satijalab/seurat-data";
        rev = "HEAD";
        sha256 = "sha256-dyv8ttrVaGwd5tPle2+wDHMa8lVjozZnVMsKArEMTPE=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          cli
          crayon
          rappdirs
          SeuratObject;
      };
    });

    seurat-disk = (pkgs.rPackages.buildRPackage {
      name = "seurat-disk";
      src = pkgs.fetchgit {
        url = "https://github.com/mojaveazure/seurat-disk";
        rev = "HEAD";
        sha256 = "sha256-tQXes2KRHFpH8mSY4DCdqBHzcMx0okt1SbN6XdLESVU=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          cli
          crayon
          hdf5r
          Matrix
          R6
          rlang
          Seurat
          SeuratObject
          stringi
          withr;
      } ++ [ seurat-data ];
    });

This is because seurat-data is a remote dependency of seurat-wrappers https://github.com/satijalab/seurat-wrappers/blob/master/DESCRIPTION but also as a dependency of the dependency package seurat-disk https://github.com/mojaveazure/seurat-disk/blob/master/DESCRIPTION (although it's confusing because it's named SeuratData here and listed under suggests).

I used a similar approach as previously, but now put it in fetchgit. At least int his case, this remove the double entry

@mihem
Copy link
Contributor Author

mihem commented Jan 18, 2025

@b-rodrigues However, I still cannot build this package here.
I think seurat-wrappers is a good example because it has so many remote dependencies.
So nix-build then fails with

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/z0h0p53czz33cnhsp6v4drzjsdclifl0-source/pkgs/stdenv/generic/make-derivation.nix:336:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'
         at /nix/store/z0h0p53czz33cnhsp6v4drzjsdclifl0-source/pkgs/stdenv/generic/make-derivation.nix:383:7:
          382|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          383|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          384|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'R' missing
       at /home/mischko/develop/rix_remote_dependencies/default.nix:83:11:
           82|         inherit (pkgs.rPackages)
           83|           R
             |           ^
           84|           Rcpp
       Did you mean one of AR, ER, QR, R0 or R6?

I can fix this error by removing the harmony entry and put harmony into propagatedBuildInputs (as you explained in the docs for httr2).

Buidling start then on my machine, buit fails with

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called 'Seurat'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'SeuratData'
* removing '/nix/store/k2g8gx8fygz49rwnsnrsm2clmillrbv9-r-seurat-data/library/SeuratData'
error: builder for '/nix/store/lsdarf2g2yfss8jgnfi9zipba9dmbhx2-r-seurat-data.drv' failed with exit code 1;
       last 20 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/vvl9znfzkflg58qq5nsv104ngyibrbpd-seurat-data
       > source root is seurat-data
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Running phase: installPhase
       > * installing *source* package 'SeuratData' ...
       > ** using staged installation
       > ** R
       > ** exec
       > ** inst
       > ** byte-compile and prepare package for lazy loading
       > Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
       >   there is no package called 'Seurat'
       > Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
       > Execution halted
       > ERROR: lazy loading failed for package 'SeuratData'
       > * removing '/nix/store/k2g8gx8fygz49rwnsnrsm2clmillrbv9-r-seurat-data/library/SeuratData'
       For full logs, run 'nix log /nix/store/lsdarf2g2yfss8jgnfi9zipba9dmbhx2-r-seurat-data.drv'.
error: 1 dependencies of derivation '/nix/store/4fgd7yk8nkwabpyrqjl0q83am7w8ar8n-r-seurat-wrappers.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vak7j9x1fag9c6gc4qpfzxsvnwqs040m-nix-shell.drv' failed to build

@mihem mihem force-pushed the fix_double_remote_packages_nested branch from 829e74f to 46bc376 Compare January 18, 2025 21:52
This was referenced Jan 19, 2025
@mihem
Copy link
Contributor Author

mihem commented Jan 21, 2025

@b-rodrigues I think you can ignore my last message, let's try to solve this in #390.
The PR itself should be relatively straight forward , so hopefully can be easily merged. Let me know if you want any revisions.

@b-rodrigues
Copy link
Contributor

can you rebase on main and force push again? LGTM

@mihem mihem force-pushed the fix_double_remote_packages_nested branch from 46bc376 to a2efebe Compare January 21, 2025 12:49
@mihem
Copy link
Contributor Author

mihem commented Jan 21, 2025

done

@b-rodrigues b-rodrigues merged commit bc9b325 into ropensci:main Jan 21, 2025
13 of 14 checks passed
@b-rodrigues
Copy link
Contributor

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants